Skip to Content
HTML & XHTML: The Definitive Guide, 6th Edition
book

HTML & XHTML: The Definitive Guide, 6th Edition

by Chuck Musciano, Bill Kennedy
October 2006
Intermediate to advanced
680 pages
21h 44m
English
O'Reilly Media, Inc.
Content preview from HTML & XHTML: The Definitive Guide, 6th Edition

Applying Styles to Documents

You should consider several issues before, during, and after you use styles in your web documents and document collections. The first, overarching issue is whether to use them at all. Frankly, few of the style effects are unique; you can achieve most of them, albeit less easily and with much less consistency, via the physical and content-based style tags (e.g., <i> and <em>) and the various tag attributes (e.g., color and background).

To Style or Not to Style

We think the CSS2 standard is a winner, not only over JavaScript-based standards but also for the convenience and effectiveness of all of your markup documents, including HTML, XHTML, and most other XML-compliant ones. Most browsers in use today support CSS1 and many of the features of CSS2. The benefits are clear. So, why wouldn't you use styles?

Although we strongly urge you to learn and use CSS2 stylesheets for your documents, we realize that creating stylesheets is an investment of time and energy that pays off only in the long run. Designing a stylesheet for a one- or two-page document is probably not time effective, particularly if you won't be reusing the stylesheet for any other documents. In general, however, we believe the choice is not if you should use CSS2 stylesheets, but when.

Which Type of Stylesheet, and When

Once you have decided to use cascading stylesheets (for pain or pleasure), the next question is which type of stylesheet—inline, document level, or external—you should apply, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

HTML and CSS: Visual QuickStart Guide, 9th Edition

HTML and CSS: Visual QuickStart Guide, 9th Edition

Joe Casabona

Publisher Resources

ISBN: 0596527322Errata Page