The <font> tag allows you to specify the color, the size, and the font family to be used in the text. The syntax for the <font> tag is:
The following 7 sizes are supported. The default size is 3.
Layout | HTML tags |
---|---|
This is a size 1 text | <font size="1">This is a size 1 text</font> |
This is a size 2 text | <font size="2">This is a size 2 text</font> |
This is a size 3 text | <font size="3">This is a size 3 text</font> |
This is a size 4 text | <font size="4">This is a size 4 text</font> |
This is a size 5 text | <font size="5">This is a size 5 text</font> |
This is a size 6 text | <font size="6">This is a size 6 text</font> |
This is a size 7 text | <font size="7">This is a size 7 text</font> |
The font color can be given by its RGB encoding or by (supported) name:
Layout | HTML tags |
---|---|
This is a "crimson" color | <font color="#DC143C">This is a "crimson" color</font> |
This is a "green" color | <font color="green">This is a "green" color</font> |
The font face can be specified by its name. Warning: not all font families might be installed on your computer!
Layout | HTML tags |
---|---|
This is a "serif" font | <font face="serif">This is a "serif" font</font> |
This is a "sans-serif" font | <font face="sans-serif">This is a "sans-serif" font</font> |
This is a "monospace" font | <font face="monospace">This is a "monospace" font</font> |
This is a "helvetica" font | <font face="helvetica">This is a "helvetica" font</font> |
This is a "fantasy" font | <font face="fantasy">This is a "fantasy" font</font> |
To create subscripts use the <sub> . . . </sub> tags. The text between those tags will be put below the font base line. Similarly, the text between the <sup> . . . </sup> tags will be placed above the base font line forming a superscript.
Layout | HTML tags |
---|---|
H2SO4 | H<sub>2</sub>SO<sub>4</sub> |
a2 - b2 = (a - b)(a + b) | a<sup>2</sup> - b<sup>2</sup> = (a - b)(a + b) |