HTML Fonts

Fonts are used to change the style of text on webpage. If you not specify any font it will take the default font, default font size, default font color. If you want to change the way of looking text on webpage you can use different fonts. Using <font> tag we can change the style of the text.

<font>Some text which needs to style</font>
<font size="1">Font size 1 </font><br>
<font size="2">Font size 2 </font><br>
<font size="3">Font size 3 </font><br>
<font size="4">Font size 4 </font><br>
<font size="5">Font size 5 </font><br>
<font size="6">Font size 6 </font><br>
<font size="7">Font size 7 </font><br>

In the above example we have size attribute which specifies the size of the text. It has the values form 1 to 7. Font size supports only 1 to 7 size values, if you specify the size 8 it will not change any font size.

Face attribute:

You can use face attribute to change the font face. We can have different style font on webpage for a text.

<font face="Times New Roman" size="3">Times New Roman</font><br>
<font face="Verdana" size="3">Verdana</font><br>
<font face="Comic sans MS" size="3">Comic sans MS</font><br>
<font face="Wildwest" size="3">Wildwest</font><br>

Color attribute:

You can specify any kind of color to the text using color attribute. If you want to use the different color for the specific text you can use color attribute.

<font color="#ff0" size="3">Times New Roman</font><br>
<font color="#000" face="Verdana" size="3">Verdana</font><br>
<font color="#ccc" face="Comic sans MS" size="3">Comic sans MS</font><br>
<font color="red" face="Wildwest" size="3">Wildwest</font><br>

Here, you can use the color name as value or you can use color code.

Font Size, Font Face, Font Color:

You can use all the attributes of font to make text changes.

<font face="Times New Roman" color="red" size="3">This text will display in Times New Roman font in red color and size will be 3</font>

Note: Now days no one use the tag to style the text, instead people uses the <style> to change the style of the text, to change color, to change the background color and so on.