HTML CSS IMAGES LINKS
 
HTML → The font tag and related attributes

All attributes discussed on this page have been deprecated. A deprecated element or attribute is one that has been outdated by newer constructs. In general, authors should use style sheets to achieve stylistic and formatting effects rather than HTML presentational attributes. HTML presentational attributes have been deprecated when style sheet alternatives exist. Almost all attributes that specify the presentation of an HTML document (e.g., colors, alignment, fonts, graphics, etc.) have been deprecated in favor of style sheets.

The Font tag along with its attributes allows you to change the color, size and face of a single letter, a sentence, a paragraph or even a whole document.

In order to change any of these attributes you must first code in the font tag followed by the attributes you wish to control and their values.
The text you want to affect will be nested between the openning font tag and its closing tag.



Font Color

If you just want to change the color of a word or a sentence, you do so with the color attribute of the font tag

<font color="#ff0000">Hello</font>

Font Size

You can also change the size of a font. Font sizes are not equivalent to point sizes. The options for font sizes are as follows:

<font size="7">...</font>
<font size="6">...</font>
<font size="5">...</font>
<font size="4">...</font>
<font size="3">...</font>
<font size="2">...</font>
<font size="1">...</font>



Font Face

If you just want to change the font face, you do so with the face attribute of the font tag. You can indicate the first choice for your font, perhaps Helvetica. If the computer does not have that font, you can request a second choice, perhaps Arial, if the computer does not have either font face you can request that it default to a Sans-Serif (without serifs font) A serif font would be Times Roman.

<font face="Helvetica, Arial, Sans-Serif">Hello</font>

You are not limited to changing only one attribute in a font tag at a time.

<font color="#ff0000" size="4" face="Helvetica, Arial, Sans-Serif">Hello</font>


 
  back ↑