HTML <font> Tag

This “HTML Fonts” post providing all complete information about how to use font tag and its properties with clear examples and explanation. HTML-5 doesn’t support Font tag. How to set styles to Font tag and much more.


<font> tag:

  • Not Supported in HTML5.
  • Use CSS instead.
  • The <font> tag specifies the font face, font size, and color of text.

<!DOCTYPE html>
<html>
<body>
<p><font size=”3″ color=”red”>Hi, Hello!</font></p>
<p><font size=”2″ color=”blue”>This is HTML tutorial!</font></p>
<p><font face=”verdana” color=”green”>Enjoy reading…..!</font></p>
</body>
</html>

 

  • Font setting using style object : The font-family property defines the font to be used for an HTML element:
    <!DOCTYPE html>
    <html>
    <body>
    <h1 style=”font-family:verdana”>This is a heading</h1>
    <p style=”font-family:courier”>This is a paragraph.</p>
    </body>
    </html>

 

  • Text Size : The font-size property defines the text size to be used for an HTML element
    <!DOCTYPE html>
    <html>
    <body>
    <h1 style=”font-size:300%”>This is a heading</h1>
    <p style=”font-size:160%”>This is a paragraph.</p>
    </body>
    </html>

 

  • Text Alignment : The “text-align” property defines the horizontal text alignment for an HTML element
    <!DOCTYPE html>
    <html>
    <body>
    <h1 style=”text-align:center”>Centered heading</h1>
    <p>This is a paragraph.</p>
    </body>
    </html>

 

<!DOCTYPE html>
<html>
<body>
<marquee style=”font-size : 50px ; text-decoration: line-through”>
Welcome to java2python.com
</marquee><br/><br/>
<marquee style=”font-size : 40px ; text-decoration: underline”>
welcome to all
</marquee>
</body>
</html>


Next Topic:                     HTML style Object – HTML Tutorial

Share this