How to use small font in HTML?

To set the small font in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML

tag, with the CSS property font-size. HTML5 do not support the 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

Example

You can try the following code to add font smaller than the default font in an HTML page


   
      HTML smaller font
   

   
      

Heading

     

This is demo content.

     

This text will be smaller.

   

Output

Updated on: 2021-12-22T09:43:02+05:30

5K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements