JavaScript EditorBest javascript editor debugger     Ajax website 



Main Page

Previous Page
Next Page

Choosing a Font Family

One of the most important choices you'll make for your Web site is the font that you'll use for the body and for headlines.

Figure 10.2. I've specified the very common Arial Black for the headlines. For paragraphs, I've chosen Palatino Linotype, a font common on Windows systems.


To set the font family:

After the desired selector in your style sheet, type font-family: name, where name is your first choice of font.

Figure 10.3. On this Windows XP system, Palatino Linotype was installed by default and thus displays properly here.


Tips

  • Surround multi-word font names with quotes (single or double).

  • If your font names contain non-ASCII characters, you'll have to declare the encoding for your style sheet as described on page 332.

  • While you can specify any font you want, your visitor will only see the fonts that they already have installed on their system. See the next page for more details.

    Figure 10.4. Palatino Linotype is not installed on most Macintosh systems by default. If you choose a font that is not installed on your visitor's system, their browser, as shown here, will use the default font instead (in this case, that is Times).

  • You can set the font family, font size, and line height all at once, using the general font property (see page 159).

  • The font-family property is inherited.



Previous Page
Next Page


JavaScript EditorBest javascript editor debugger     Ajax website 
R7