asp is fun


HTML Tips and Techniques
Working with Fonts



Sure, you can make things bold and italic. But what if you want to specify the actual font being used, or its size? This is where the FONT command comes in quite handy.

The FONT command lets you set the exact font being used. Note that the user's machine has to know how to *display* the font, so you can't use a really exotic font. You need to use one that most machines come with automatically.

You show the font by saying

<FONT FACE="fontname">THIS TEXT IS IN THE NEW FONT</font>

Anything between the on-font and the off-font will be shown in the special font.

The ones that are very common, and therefore good to use, are:

<font face="Arial">font face="Arial"</font>
<font face="Courier">font face="Courier"</font>
<font face="Courier New">font face="Courier New"</font>
<font face="Script">font face="Script"</font>
<font face="Times Roman">font face="Times Roman"</font>

You can supply more than one font name, to provide backups. This is good for fonts that are different on Macs vs PCs. For example, to make really sure that a block of text shows up sans-serif (i.e. without the little 'edges' on the letters) you could specify

Arial, Helvetica

as your font choices. This means the machine will first try to use Arial, then if it can't find Arial it'll try to use Helvetica.

To change the size, you use the FONT SIZE command. This is a relative size, from +1 to +2 to make it larger, or -1 or -2 to make it smaller. So to make a larger font you could say

<FONT SIZE=+2>FONT SIZE=+2</FONT>

Enjoy!

Lisa's HTML Tips and Techniques Homepage

Other Sites by Lisa
ASP Code & Help Java Code & Help Gaming Walkthroughs