Chapter 2. CSS


As we explained in Chapter 1, "The Web and HTML," HTML elements enable Web-page designers to mark up a document's structure. The HTML specification lists guidelines on how browsers should display these elements. For example, you can be reasonably sure that the contents of a STRONG element will be displayed as boldfaced. Also, you can pretty much trust that most browsers will display the content of an H1 element using a big font size at least bigger than the P element and bigger than the H2 element. But beyond trust and hope, you don't have any control over your text's appearance.

HTML is the most popular document format on the Web, and it is used in most of the examples in this book. However, you can use CSS to style other document languages, including XHTML (which is a dialect of HTML) and XML (which uses different tags than HTML does).


CSS changes that. CSS puts the designer in the driver's seat. We devote much of the rest of this book to explaining what you can do with CSS. In this chapter, we begin by introducing you to the basics of how to write style sheets and how CSS and HTML work together to describe both the structure and style of your document.

To start using CSS, you don't even have to write style sheets. Chapter 14, "External Style Sheets," tells you how to point to existing style sheets on the Web.




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