CoderTools Web site

HTML Font

The <Font> Tag

(Deprecated - use CSS instead)

Use the font tag to set the font color, font size, and font styles of text. All text encapsulated by the font tag will be affected.


Examples


Example:

Red text, times new roman typeface, size 5.

The code:

    
        <font color="#ff0000" face="times new roman" size=5>
            Red text, times new roman typeface, size 5.
        </font>Give it a go!
    

Different typefaces example:

Red text, verdana typeface.
Green text, arial typeface.
Blue text, georgia typeface.
Black text, times new roman typeface.

The code:

    
        <font color="#ff0000" face="verdana" size="4">
            Red text, verdana typeface.
        </font>
        <font color="#00ff00" face="arial" size="4">
            Green text, arial typeface.
        </font>
        <font color="#0000ff" face="georgia" size="4">
            Blue text, georgia typeface.
        </font>
        <font color="#000000" face="times new roman" size="4">
            Black text, times new roman typeface.
        </font>Give it a go!
    

Attributes for <font>


Name Values Description
color #rrggbb e.g. #ff0000 for red The color of the text using a hexadecimal RGB value.
face typeface e.g. verdana The typeface of the text e.g. times new roman, arial, verdana.
size 1|2|3|4|5|6|7|+1|+2|+3|+4|-1|-2 The size of the text. Specified using a scale from 1 to 7 where 3 is the default. Alternatively you can use relative values for example +2 or -1 which is relative to the default or the <basefont>

4/27/2017 8:01:50 AM
Terms Of Use | Privacy Statement | Copyright 2006-2015 © Independence Software LLP