Cascading Style Sheets: The Definitive Guide
  • Alternative view 1 of Cascading Style Sheets: The Definitive Guide
  • Alternative view 2 of Cascading Style Sheets: The Definitive Guide

Cascading Style Sheets: The Definitive Guide

by Eric A. Meyer
     
 

View All Available Formats & Editions

When we released Cascading Style Sheets: The Definitive Guide in 2000, we believed CSS was poised to become a major force in web authoring -- and we were right. Since then, CSS has continued to mature as a standard, dozens of books have been published on the topic, and most recent browsers have at least partial support for CSS2 and excellent support for CSS1. CSS is…  See more details below

Overview

When we released Cascading Style Sheets: The Definitive Guide in 2000, we believed CSS was poised to become a major force in web authoring -- and we were right. Since then, CSS has continued to mature as a standard, dozens of books have been published on the topic, and most recent browsers have at least partial support for CSS2 and excellent support for CSS1. CSS is the W3C-approved method for adding to and enriching the visual presentation of web documents. It allows web authors to mimic the sophisticated layout and pagination of desktop publishing with clean, easy-to-maintain scripts. This second edition of Cascading Style Sheets: The Definitive Guide completes the discussion of CSS2, explores CSS2.1, and introduces emerging elements of CSS3. Eric A. Meyer, now an even more respected expert on the subject of CSS, uses his trademark wit and humor to explore properties, tags, attributes, and implementation, as well as real-life issues, such as browser support and design guidelines. This book addresses experienced web authors and scripters, as well as novice authors who may be implementing CSS from scratch. Cascading Style Sheets: The Definitive Guide, Second Edition also includes a new foreword by Molly Holzschlag, a steering committee member for the Web Standards Project and one of the Top 25 Most Influential Women on the Web.

Read More

Editorial Reviews

bn.com
The Barnes & Noble Review
With CSS 2/2.1, web designers have the near-absolute control they’ve always craved. The standards are pretty well nailed, the tools are there, the browsers are close enough. Strong CSS skills are now indispensable. Eric A. Meyer’s Cascading Style Sheets: The Definitive Guide, Second Edition is the best way to get them.

Nobody knows the realities of CSS better than Meyer -- nobody. Here, he covers it all: document structure, values, units, fonts, text, visual formatting, borders, margins, colors, backgrounds, positioning, tables, lists, you name it. Meyer presents the why, the how, the pitfalls, the solutions -- and plenty of visual examples. Bill Camarda

Bill Camarda is a consultant, writer, and web/multimedia content developer. His 15 books include Special Edition Using Word 2003 and Upgrading & Fixing Networks for Dummies, Second Edition.

Library Journal
Although O'Reilly books are not the best place to learn how to use a technology, they are excellent for polishing its finer points. Ethernet and Internet protocols are difficult by nature, but cascading style sheets and MP3s are much more accessible to beginners. All of these books are recommended for university and large public libraries; Cascading Style Sheets and MP3 will also serve well smaller public libraries.
Booknews
Cascading Style Sheets (CSS) is a standard way to separate a document's structure from its presentation, and is gradually gaining support among web browsers. This guide offers a detailed review of using aspects of CSS1 and CSS positioning to enrich the visual presentation of web pages. Topics include text properties, fonts, colors and backgrounds, boxes and borders, and visual formatting. Annotation c. Book News, Inc., Portland, OR (booknews.com)

Read More

Product Details

ISBN-13:
9780596005252
Publisher:
O'Reilly Media, Incorporated
Publication date:
03/28/2004
Edition description:
Second Edition
Pages:
528
Product dimensions:
6.78(w) x 9.42(h) x 0.94(d)

Read an Excerpt


Chapter 1: HTML and CSS

In many ways, the Cascading Style Sheets (CSS) specification represents a unique development in the history of the World Wide Web. In its inherent ability to allow richly styled structural documents, CSS is both a step forward and a step backward--but it's a good step backward, and a needed one. To see what is meant by this, it is first necessary to understand how the Web got to the point of desperately needing something like CSS, and how CSS makes the web a better place for both page authors and web surfers.

The Web's Fall from Grace

Back in the dimly remembered early years of the Web (1990 -1993), HTML was a fairly lean little language. It was almost entirely composed of structural elements that were useful for describing things like paragraphs, hyperlinks, lists, and headings. It had nothing even remotely approaching tables, frames, or the complex markup we assume is a necessary part of creating web pages. The general idea was that HTML would be a structural markup language, used to describe the various parts of a document. There was very little said about how these parts should be displayed. The language wasn't concerned with appearance. It was just a clean little markup scheme.

Then came Mosaic.

Suddenly, the power of the World Wide Web was obvious to almost anyone who spent more than ten minutes playing with it. Jumping from one document to another was no harder than pointing the mouse cursor at a specially colored bit of text, or even an image, and clicking the mouse button. Even better, text and images could be displayed together, and all you needed to create a page was a plain text editor. It was free, it was open, and it was cool.

Web sites began to spring up everywhere. There were personal journals, university sites, corporate sites, and more. As number of sites increased, so did the demand for new HTML tags that would allow one effect or another. Authors started demanding that they be able to make text boldfaced, or italicized.

At the time, HTML wasn't equipped to handle these sorts of desires. You could declare a bit of text to be emphasized, but that wasn't necessarily the same as being italicized--it could be boldfaced instead, or even normal text with a different color, depending on the user's browser and their preferences. There was nothing to ensure that what the author created was what the reader would see.

As a result of these pressures, markup elements like <B> and <I> started to creep into the language. Suddenly, a structural language started to become presentational.

What a Mess

Years later, we have inherited the flaws inherent in this process. Large parts of HTML 3.2 and HTML 4.0, for example, are devoted to presentational considerations. The ability to color and size text through the FONT element, to apply background colors and images to documents and tables, to space and pad the contents of table cells, and to make text blink on and off are all the legacy of the original cries for "more control!"

If you want to know why this is a bad thing, all it takes is a quick glance at any corporate web site's page markup. The sheer amount of markup in comparison to actual useful information is astonishing. Even worse, for most sites, the markup is almost entirely made up of tables and FONT tags, none of which conveys any real semantic meaning to what's being presented. From a structural standpoint, these pages are little better than random strings of letters.

For example, let's assume that for page titles, an author is using FONT tags instead of heading tags like H1, like this:

<FONT SIZE="+3" FACE="Helvetica" COLOR="red">Page Title</FONT>

Structurally speaking, the FONT tag has no meaning. This makes the document far less useful. What good is a FONT tag to a speech-synthesis browser, for example? If an author uses heading tags instead of FONT tags, the speaking browser can use a certain speaking style to read the text. With the FONT tag, the browser has no way to know that the text is any different from other text.

Why do authors run roughshod over structure and meaning like this? Because they want readers to see the page as they designed it. To use structural HTML markup is to give up a lot of control over a page's appearance, and it certainly doesn't allow for the kind of densely packed page designs that have become so popular over the years...

Read More

Meet the Author


Eric A. Meyer has been working with the Web since late 1993. He is currently the Hypermedia Systems Manager for Digital Media Services at Case Western Reserve University, Eric has been called "an internationally recognized expert on the subjects of HTML and Cascading Style Sheets (CSS)," and he knows a thing or two about other aspects of Web design as well. He is an invited expert and member of the W3C CSS&FP Working Group, coordinates the W3C's CSS Test Suite, remains active on CSS newsgroups, and edits Web Review's Style Sheets Reference Guide. He does as much writing as he can without burning out, and also does his best to keep up with CSS support in popular Web browsers. If you have a taste for early jazz and swing, you can catch his weekly big band radio show over the Internet via WRUW-FM 91.1 in Cleveland. When not otherwise busy, Eric is usually bothering his wife Kat in some fashion.

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >