O'Reilly logo

HTML & XHTML: The Definitive Guide, 5th Edition by Chuck Musciano, Bill Kennedy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Cascading Style Sheets

Style sheets are the way publishing professionals manage the overall “look” of their publications — backgrounds, fonts, colors, and so on — from a single page to huge collections of documents. Most desktop-publishing software supports style sheets, as do popular word processors, so the necessity of style sheets for HTML documents was obvious.

From the start, HTML focused on content over style. Authors are encouraged to worry about providing high-quality information and leave it to the browser to worry about presentation. We strongly urge you to adopt this philosophy in your documents — don’t mistake style for substance.

However, presentation is for the benefit of the reader, and even the original designers of HTML understood the interplay between style and readability — for example, through the physical style and header tags. Style sheets extend that presentation with several additional effects, including colors, a wider selection of fonts, and even sounds so that users can better distinguish elements of your document. But most importantly, style sheets let you control the presentation attributes for all the tags in a document — for a single document or a collection of many documents — from a single master.

In early 1996, the World Wide Web Consortium (W3C) put together a draft proposal defining Cascading Style Sheets (CSS) for HTML. This draft proposal quickly matured into a recommended standard. In mid-1998, the W3C extended the original specification ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required