HTML Fonts

Next Page Previous Page

The HTML <font> is used to add various forms of text styles like different sizes, different colors, and families to our web page, just like MS word and other text editors that give some cool text styles to make the content less boring and attractive.

Note : HTML <font> tag is no longer in use by HTML 5, CSS font family have taken over the <font> tag.

Syntax :

<font size = “size- for- font” face=”font-family-name” color=”color-for-font”>        
            Your text you want to style. 
</font>

Attributes in Font :

  • Size
  • Color
  • Face/ Type / Family 

Size

here we decide the size for the text.

Example:

<!DOCTYPE html> 
<html> 
	<head> 
		<title>HTML Font Tag</title> 
	</head> 
	
	<body> 
		<font size = "1">Example for Font size attribute !!</font><br /> 
		<font size = "2">Example for Font size attribute !!</font><br /> 
		<font size = "3">Example for Font size attribute !!</font><br /> 
		<font size = "4">Example for Font size attribute !!</font><br /> 
		<font size = "5">Example for Font size attribute !!</font><br /> 

	</body> 
</html>		

Color : 

Here we are setting the color for our text.

Example:

<!DOCTYPE html> 
<html> 
	<head> 
		<title>HTML Font Tag</title> 
	</head> 
		<body> 
		<font size = "1" color="red">Example for Font color attribute !!</font>
		<br/> 
		<font size = "2" color="blue">Example for Font color attribute !!</font>
		<br/> 
		<font size = "3" color="yellow">Example for Font color attribute !!</font>
		<br/> 
		<font size = "4" color="green">Example for Font color attribute !!</font>
		<br/> 
		<font size = "5" color="purple">Example for Font color attribute !!</font>
		<br/> 
	</body> 
</html>	

Face/Type?family:

Here we decide the family or type of out text.

Example:

<!DOCTYPE html> 
<html> 
	<head> 
		<title>HTML Font Tag</title> 
	</head> 
		<body> 
		<font size = "1" color = "red" face = "Times New Roman">Example for Font color attribute !!</font>
		<br/> 
		<font size = "2" color = "blue" face = "Verdana">Example for Font color attribute !!</font>
		<br/> 
		<font size = "3" color = "yellow" face = "Comic sans MS">Example for Font color attribute !!</font>
		<br/> 
		<font size = "4" color = "green" face = "WildWest">Example for Font color attribute !!</font>
		<br/> 
		<font size = "5" color = "purple" face = "WildWest">Example for Font color attribute !!</font>
		<br/> 
	</body> 
</html>	

Browser Support :

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari
Next Page Previous Page

Treding Tutorial

Popular Tutorials

to Learn now