13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6: FontsFigure 6-3 shows how various browsers render generic fonts. From the output shown in those figures,you can see that generic font rendering is not exactly identical between browsers and plat<strong>for</strong>ms. Fontsthat display consistently are serif, sans-serif, and monospace. Because of the wildly varying differencesin rendering of the fantasy and cursive fonts, designers seldom use these two fonts.In the notation <strong>for</strong> the font-family property documentation, refers to the possiblespecification of a generic font name. Often a generic font is included as a last fallback option, as shownin the following rule:p {}font-family: Arial, Shruti, Tahoma, Mangal, Helvetica, sans-serif;The addition of sans-serif to the end of the font list <strong>for</strong> the font-family property means that as a lastresort, if none of the other fonts specified are installed on the user’s computer, the generic sans-serif fontshould be used.Use the following Try It Out to experiment with the font-family property <strong>for</strong> yourself.Try It OutApplying the font-family PropertyExample 6-1. Follow these steps to experiment with the font-family property.1. Write the following markup in your text editor:font-familyThe font-family property allows you to specify afont face.It has the built-in ability of allowing you tospecify fallback fonts,fonts that are used when your first choice(or choices) aren’t installed on the end user’s OS.Even though, these days, because of the dominance of theWindows plat<strong>for</strong>m,cross-plat<strong>for</strong>m fonting is less of an issue.2. Save Example_6-1.html.173

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

Saved successfully!

Ooh no, something went wrong!