Chapter 5. Fonts


Specifying typesetting properties is one of the most common uses of style sheets. Such properties include a font's size, its width, its weight (is it light or bold?), and its posture (does it slant or stand upright?).

Getting the fonts you want with HTML is difficult because HTML was designed without any concept of fonts. In HTML, the appearance of the page is the result of the browser's inserting styles it thinks are appropriate. It does this using the HTML structural information in your document. The lack of control over fonts in HTML has led to documents containing pictures of text instead of text. By making pictures of text, designers get total control over fonts. They can pick and choose between any font they have on their own machine and don't have to worry about which fonts are available on the user's machine. The downside of using images is that documents become big and download slowly.

CSS has been designed to give designers the influence over fonts they request without having to resort to images. This is done by setting values on a set of font properties that are defined in CSS. In previous chapters, you saw examples of these properties. For example, the font-style, font-weight, and font properties were used in Chapter 2, "CSS." In this chapter, you find the full definition of all font properties and the values they can take. Also, there are more examples of how they can and should be used in style sheets.

This chapter introduces you to typesetting terminology before moving on to describing the CSS font properties. Along the way, we also describe the units of measurements used by the font properties. These units are also used by other properties, so pay attention!



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net