XML technologies / CSS / CSS Cookbook / Typography for the web
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
Introduction
Before CSS, web developers used tags font to set text color, size and appearance in different page areas:
<font face="Verdana, Arial, sans-serif" size="+1" color="blue">Hallo Welt!</font>Although effective at controlling font appearance, this technique had limitations. Frequent use of tags font on many pages made updates extremely time-consuming and unnecessarily enlarged documents. The approach was also error-prone. CSS avoids these design and maintenance problems. To demonstrate, enclose some content in tags p:
<p>Hallo Welt!</p>Now define the paragraph’s appearance in the document head:
<style type="text/css" media="all">
p {
color: blue;
font-size: small;
font-family: Verdana, Arial, sans-serif;
}
</style>This separates paragraph structure from visual presentation, greatly simplifying design editing and maintenance. Presentation can now be changed in a stylesheet without modifying the content itself.
Compared with earlier techniques, this provides easier editing and much finer typographic control. Besides changing font color, style and size, this chapter covers drop caps, attractive pull quotes, changing leading, and much more.
Copyright of the German edition © 2007 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “CSS Kochbuch” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln