HTML Font


he It is used to set the font of the text.

 *openging <font> and closeing </font> tag.

Attributes:

  1. Face
  2. Size
  3. Color

FACE:

It sets the type of the font.

HTML Font face Example

<html> 
 <head>  
  <title> Welcome to HTML Tutroial </title> 
 </head>  
 <body>  
   <font face="Times New Roman" size="10">Times New Roman</font>
   <font face="Verdana" size="10">Verdana </font>
   <font face="Comic sans MS" size="10">Comic Sans MS </font>
  </body>  
</html>

Output

Times New Roman
   Verdana 
   Comic Sans MS 

SIZE:

It sets the size of the text. We can also set the relative value using the "+" or "-" sign.

HTML Font Size Example

<html> 
 <head>  
  <title> Welcome to HTML Tutroial </title> 
 </head>  
 <body>  
  <font size="1">Font size="1"</font>
  <font size="2">Font size="2"</font>
  <font size="3">Font size="3"</font>
  <font size="4">Font size="4"</font>
  <font size="5">Font size="5"</font>
           
  <font size="+1">Font size="+1"</font>
  <font size="+2">Font size="+2"</font>
  <font size="+3">Font size="+3"</font>
  <font size="+4">Font size="+4"</font>
  </body>  
</html>

Output

Font size="1"
Font size="2"
Font size="3"
Font size="4"
Font size="5"

Font size="-1"
Font size="+1"
Font size="+2"
Font size="+3"
Font size="+4"

COLOR:

"#RRGGBB" , sets the color of the text within the font tag.

HTML Font Color Example

<html> 
 <head>  
  <title> Welcome to HTML Tutroial </title> 
 </head>  
 <body>  
  <font color="#FF00FF">This text is hexcolor #FF00FF</font>
  <font color="red">This text is red</font>
  </body>  
</html>

Output

This text is hexcolor #FF00FF
    This text is red

HTML Font Color Example

<html> 
  <head>  
   <title> Welcome to HTML Tutroial </title> 
  </head>  
  <body>  
   <font color="#338844" size="20px" face="Comic Sans MS"> HTML Font Text </font>
   </body>  
</html>

Output

HTML Font Text

Share this article on