| Ziskind.com > Lemcon > HTML Tips & Tricks > Fonts | Tuesday, May 13, 2008 |
|
Font Documentation
The <FONT> tag gives you a lot more control over the text in your HTML document then headers. <H1>..<H6> The major advantage of fonts is that changing the text size does not force the text onto a new line. There are a number of ways of using fonts in HTML documents. The default font size is 3, with a range of 1 to 7, so the following pieces of code produce the same output. <font SIZE=+2>Hello!</font> <font SIZE=5>Hello!</font> A Netscape specific tag, <basefont size=#> allows the changing of the base font size in the document. <basefont SIZE=4> <font SIZE="+2">Hello!</font> <font SIZE=5>Hello!</font>
Multiple font changes can occur on the same line: <font SIZE="+4">W</font> <font SIZE="+3">E</font> <font SIZE="+2">L</font> <font SIZE="+1">C</font> O <font SIZE="-1">M</font> <font SIZE="-2">E</font> <font SIZE="-1">!</font> <font SIZE="+0">!</font> <font SIZE="+1">!</font> <font SIZE="+2">!</font> <font SIZE="+3">!</font> <font SIZE="+4">!</font>
You can also change the color of fonts! Colors are modified using RGB in hexadecimal. <font COLOR="#FF0000">RED </font> <font COLOR="#00FF00">GREEN</font> <font COLOR="#0000FF">BLUE </font> <font COLOR="#00FFFF">CYAN</font>
In newer web browsers you can use color names instead of hexadecimal values. Netscape supports 140 colors, but there are 16 standard color names which are supported by nearly all browsers which support color names.
Font sizes and colors can be combined as well: <font COLOR="#00FF00" SIZE="+4">B</font> <font COLOR="#0000FF" SIZE="+4">I</font> <font COLOR="#FFFF00" SIZE="+4">G</font> <font COLOR="#FF0000" SIZE="+2">RED</font>
Many browsers now support font faces. This means you can have text display in a specific font to all users. <font FACE="Arial,Helvetica">Arial, Helvetica</font>
|
| < HTML Tips and Tricks | |
| Copyright © 1997-2001, Ben Ziskind. All Rights Reserved. | |