22.06.2015 Views

Step by Step HTML5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

104 Chapter 7<br />

See Also Do you need only a quick refresher on the topics in this chapter? See the Key Points at<br />

the end of this chapter.<br />

Practice Files Before you can use the practice files provided for this chapter, you need<br />

to install them from the book’s companion content page to their default locations. See<br />

“Using the Practice Files” in the beginning of this book for more information.<br />

Specifying a Font Family<br />

Specifying a certain font to appear on a page can be tricky because not everyone has the<br />

same fonts installed. Even fonts that come with Microsoft Windows, such as Courier New<br />

and Arial, are not universally acceptable because not everyone who has access to the<br />

Web uses a Windows-based computer.<br />

To work around this issue, you can specify a font family rather than an individual font. A<br />

font family is a set of fonts listed in order of preference. If the computer displaying your<br />

page does not have the first font in the list, it checks for the second, and then the third,<br />

and so on until it finds a match. For example, here’s how to specify a font family in a style<br />

rule:<br />

p {font-family: "Arial", "Helvetica", sans-serif}<br />

Although no font is universally available on all PCs, there are a few generic font types<br />

that are nearly so: serif, sans-serif, cursive, fantasy, and monospace. Those font types are<br />

not specified with quotation marks around them, as is the case in the preceding example.<br />

Here’s how each of those fonts renders on a Web page.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!