How to use small font in HTML?

HTMLWeb DevelopmentFront End Technology

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 <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 the following code to add font smaller than the default font in an HTML page

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML smaller font</title>
   </head>

   <body>
      <h1>Heading</h1>
      <p>This is demo content.</p>
      <p style="color:blue;font-size:11px;">This text will be smaller.</p>
   </body>
</html>
raja
Published on 18-Jan-2018 10:35:35
Advertisements