Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Book Reviews Books Media

CSS: The Definitive Guide 160

Michael J. Ross writes "Every Web developer knows that Cascading Style Sheets (CSS) makes it possible to separate the contents of Web pages from the styling of the elements on those pages. This in turn confers tremendous advantages, such as allowing site-wide changes of appearance to be made just once, in a single stylesheet file, rather than in all of the pages containing the affected elements. The syntax and proper usage of CSS is not as simple as implied by many HTML/CSS books, most of which fail to provide enough detail as to how CSS is applied to page elements. Web developers relying upon these books soon find themselves hitting those limits, and becoming frustrated when trying to debug Web pages. CSS: The Definitive Guide, authored by CSS expert Eric A. Meyer, aims to fill that gap." Read on for the rest of Michael's review.
CSS: The Definitive Guide
author Eric A. Meyer
pages 536
publisher O'Reilly Media
rating 9
reviewer Michael J. Ross
ISBN 0596527330
summary A comprehensive CSS reference guide.

Published by O'Reilly Media in November 2006, this title is now in its third edition. The first edition appeared in May 2000, and the second in January 2004 — with each one establishing the book as an immediate favorite among hard-core Web programmers. Each revision brought it up to date with the evolution of CSS as a standard, its support among the most popular Web browsers, and its usage within the Web development community. This latest edition covers CSS2 and CSS2.1, but does not include the CSS3 modules, including those that have reached Candidate Recommendation status, because their implementation is largely incomplete among most of the browsers.

Web veteran Eric Meyer presents the book's material in a methodical manner, starting with an overview of CSS's purpose and advantages, and quickly moving into the details of the technology: selectors, structure, inheritance, values, units, fonts, text properties, visual formatting, padding, borders, margins, colors, backgrounds, floating, positioning, tables, lists, and generated content (e.g., bullets of unordered lists). The last two chapters address user interface styles (system fonts and colors, cursors, and outlines) and non-screen media (such as paged and aural content). The book's 536 pages are organized into a total of 14 chapters and three appendices. The first appendix is a complete CSS property reference, spanning more than 40 pages, with visual, page, and aural properties grouped separately. For each property, Meyer explains its purpose, its valid values, the initial value, what elements it applies to, whether it is inherited, its computed value, and additional notes (if any). The second appendix is a reference for the selectors, pseudo classes, and pseudo elements. The third and final appendix is much shorter than the first two, but no less interesting, as it discusses a sample HTML 4 stylesheet, which is presented in the CSS2.1 specification as the recommended style sheet for developers to use.

As with all of their other titles, O'Reilly Media offers a Web page devoted to this book, where visitors will find links to online versions of the book cover, table of contents, index, registration form, reader reviews, and errata (of which there are none, as of this writing). In addition, the page has offers to receive a volume discount, and to read the book online as part of O'Reilly's Safari service.

Anyone who is considering purchasing this book might initially be concerned by the dearth of feedback on the Web sites of the publisher and the major online booksellers — in the form of few reader comments, and no reported errata. The prospective reader may wrongly conclude that this indicates a lack of interest in the book, and thus it must be unpopular — probably for good reason. But just the opposite is true, as demonstrated by the book's sales rank on alone: #4631, as of this writing. Unlike far too many of the other HTML/CSS books available, this one does not engender scathing reviews by customers angry with the books' shoddy writing and sloppy mistakes. Rather, Meyer's contribution is the type of solid reference book that the discerning Web developer will quietly place on their desk or bookshelf, within easy and frequent reach — possibly displacing a dog-eared first or second edition of the same title. Furthermore, the absence of errata should suggest that most if not all kinks have been worked out of the book, and not that the book is failing to receive careful readings.

CSS: The Definitive Guide benefits not just from its multiple revisions, but also from Eric Meyer's clear and complete writing style. Unlike his more advanced books, this one is far more approachable, making it possible for the reader to easily jump into the midst of any topic and quickly pick up the thread — as is essential for any technical reference work. The theoretical discussions and the sample code demonstrate his abundant experience in using CSS in the real world, discovering or verifying its idiosyncrasies, and pushing it to its limits. Most of the critical visual and positioning topics are well illustrated with diagrams and sample output, few of which are weakened by the lack of color in the grayscale figures. Last and certainly not least, readers should be pleased that the book's material has been updated for Internet Explorer 7, which promises to fix many inexcusable problems in earlier versions of the browser.

Rarely does one come across a programming book that has no significant flaws, and will likely become a favorite resource for developers everywhere. CSS: The Definitive Guide is a comprehensive, well-written, and welcome addition to the library of any Web developer who wishes to understand and utilize CSS better.

Michael J. Ross is a Web consultant, freelance writer, and the editor of's free newsletter. He can be reached at, hosted by SiteGround.

You can purchase CSS: The Definitive Guide from Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

CSS: The Definitive Guide

Comments Filter:
  • A wonderful book (Score:5, Interesting)

    by SavedLinuXgeeK ( 769306 ) on Monday January 29, 2007 @04:11PM (#17804106) Homepage
    I purchased the previous version, and it was truly a clear and concise introduction and mastery of CSS. Mastery in the sense of understanding how CSS works, not in mastery of CSS Cookbook type "fixes". It was much better to learn the fundamentals of CSS before trying to understand why and how the hacks work the way they do. I still keep and use the book as a reference at my desk at work.
  • My question (Score:4, Interesting)

    by hypermanng ( 155858 ) on Monday January 29, 2007 @04:16PM (#17804164) Homepage
    It has been updated to account for IE7's ideosyncracies, but does it also cover the other browsers well? Every time I've started really using CSS, I 've gotten frustrated by the way each browser decided to support a different subset of CSS so I had to sit there and try everything before figuring out what non-IE-on-Windows browsers would make of the page. Probably the major browsers support much more of the CSS spec, but I was burned so bad last time I haven't wanted to touch it with a ten foot pole in several years.
  • by Anonymous Coward on Monday January 29, 2007 @04:28PM (#17804314)
    Believe me, working in a graphic design firm as a web developer, there is a large difference between a designer and a developer. Designers here work almost exclusively in Photoshop and only have to have the most rudimentary understanding of what can and can't be done using XHTML/CSS. I'd say that somebody who is used to looking at XHTML/CSS, coding from scratch, understands inheritance, and how these can be used to accurately reproduce major corporate websites across most any browsing environment qualifies as a developer.
  • IE is the roadblock (Score:4, Interesting)

    by fiannaFailMan ( 702447 ) on Monday January 29, 2007 @04:34PM (#17804388) Journal
    CSS is great in theory and should make sites easier to maintain, but in my experience all this advantage is lost when hacking to get IE to support it. I seem to have to support IE OR the rest of the world's web browsers, but I can't seem to get certain pages to support both. I've had to revert back to HTML tables for my page layouts, and I'll be sticking with that until a more CSS-friendly IE becomes more widespread. I just spend a bit of time familiarising myself with CSS and using it for text styling and some positioning within my tables. I'm sure in a year or two it'll become feasible to use CSS exclusively, and I'm quite looking forward to it.
  • by somethinghollow ( 530478 ) on Monday January 29, 2007 @04:35PM (#17804402) Homepage Journal
    Code for FireFox, Opera, or Safari. Then use conditional comments to load a stylesheet for IE to overwrite the styles it finds problematic. While conditional comments seems like a hack to me, it's an officially supported by IE hack that is officially unsupported in every other browser. If other browsers ever support it, then the "hack" still works. If IE ever stops supporting it, it's just a comment. So far, it's the only method worth using and it isn't nearly as irritating as CSS hacks (that may or may not continue to work). I usually only end up adjusting box model stuff.

    That said, IE still needs a lot of work to be compliant with CSS2. It sucks that my/our clients have to foot the bill for Microsoft's sub-par browser (instead of Microsoft).
  • by edmicman ( 830206 ) on Monday January 29, 2007 @05:22PM (#17804984) Homepage Journal
    Heh, I agree. I, too, will probably have to check this out, but I know I've heard all over how using tables for layout is bad and using CSS instead is Teh Good. But every time I try and do a layout that would take two minutes with a table, and do it it CSS, it takes many times longer to get things to actually *work* and look right. Float that to the left! Oops, once I add another column, they're both squished to the top! Etc etc....
  • by Shados ( 741919 ) on Monday January 29, 2007 @08:35PM (#17807534)
    Indeed. Honestly, CSS started from a good idea. CSS 1 handled, well, styles, like fonts, colors, etc. Thats good, and CSS is good for that. It actualy makes sense for it, the syntax is peachy good.

    Its when someone decided "Woooo, lets divide the page in 2, the logical structure and the layout!" that it got to become hell (aka: CSS2. For this post, I'll talk as if CSS2 was implemented at 100% in all browsers, to avoid some bozo saying "its microsoft's fault if you hate CSS blah blah blah).

    Since CSS came about several years ago, back in the days, it probably made sense. Today, it doesn't.

    A fairly typical enterprise web application has (for example, pulling stuff out of my ass):

    an RDBMS.
    a layer of stored procedures
    a data access layer
    a data transformation layer
    business objects
    a business logic encapsulation layer
    a business service layer
    a web service or remoting layer to distribute the app
    a controler layer for the UI
    the actual UI.

    A lot of these gets split in more categories (validation, security, etc). Now, some bozos want to start splitting it up even more. Semantic markup, styling, and if you push it, transformation (XSLT), and more. It makes sense in a web site, or a simple business front ends, like mmost transactional ecommerce sites, that have like, 5 different pages that need to be maintained a lot. But when you have several hundreds pages with vastly different just starts being pointless. The CSS1 part still has its place, to make a "theme" for the entire site. But positioning? You need 1 stylesheet -per- page, since each page is 90% different aside from the navigation. And most of the semantic part is generated from the layer right under the UI layer, so the structure vs display is -already- split. Its just redundant.

    But since all the wackos that don't get that are extremely vocal, and have been pushing it like crazy, the browsers and the web in general are going that way. So for the being, we're stuck with it. Even worse, I recently got hired by a top fortune 500 company, and amazingly enough, I'm the only one who semi-advanced (relatively speaking) knowledge of web interface technologies, so I'm stuck dealing with all of it, because when trying to explain to the other programmers whats the difference between position: relative and position: absolute, I get blank stares. Oh well. At least thats job security...

Suburbia is where the developer bulldozes out the trees, then names the streets after them. -- Bill Vaughn