
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to change font size in HTML?
To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.
Just keep in mind, the usage of style attribute overrides any style set globally. It will override any style set in the HTML <style> tag or external style sheet.
Example
You can try to run the following code to change the font size in an HTML page,
<!DOCTYPE html> <html> <head> <title>HTMLFont size</title> </head> <body> <h1 style="color:red;font-size:40px;">Heading</h1> <p style="color:blue;font-size:18px;">This is demo text</p> </body> </html>
- Related Articles
- How to change font size with HTML in Java Swing JEditorPane?
- How to change font size in ttk.Button?
- How to change text font in HTML?
- How to change the font size using CSS?
- How to change the font size of textView in android?
- How to change xticks font size in a matplotlib plot?
- How to change PowerShell ISE font Size using command?
- How to change the font size of scientific notation in Matplotlib?
- How to change the font size of Text using FabricJS?
- How to change Font Size Depending on Width of Container?
- How can I change the font family and font size with jQuery?
- How to change the font size of legend in base R plot?
- How to change the font size of a text using JavaScript?
- How to change the font size of a Textbox using FabricJS?
- How to change text font for JLabel with HTML in Java?

Advertisements