HTML - Fonts

HTML Fonts

The style, size, and color of fonts play a major role in making the web page attractive.

The chapter demonstrates about the HTML Fonts which plays an important role while making the web sites.

By using the fonts user can increase the readability and fonts are user friendly. Following are the concepts covered.

Font Size, Font Face, Font Color, Base Font

Likewise, the font tags have three attributes namely size, color, and face that help to customize the fonts.

User can give the Font style by using the <font> tag, not only style but can also give the size, color of the text in a web page. Font tag have three attributes as shown below.

size, color, face


<!DOCTYPE html>
<p><font size="3" color="red">This Is My Some Text!</font></p>
<p><font size="2" color="blue">This Is My Some Text!</font></p>
<p><font face="verdana" color="green">This Is My Some Text!</font></p>
<p><strong>Note:</strong> This font element is not supported in HTML4</p>


This Is My Some Text!

This Is My Some Text!

This Is My Some Text!

Note: Font element is not supported in HTML5

Definition and Usage

The <font> tag is not supported in HTML5. Use CSS instead.

The <font> tag specifies the font face, font size, and color of text.

Points to remember

As both the basefont & the font tags are being used a bit less now, it is suggested that users make use of the CSS styles so that they make required changes in the website.