16 June 2005 12 noon edt

CSS: A Designer’s Guide

Some CSS books are revelations, others are lightbulbs. Revelation books, typically organized around a single big idea, are like religious experiences: reading them alters your reality. Lightbulb books, built on a gently climbing path of small, connected ideas, are less intense but no less valuable. In the world of standards-based design, a revelation book converts you to the gospel of semantic markup and CSS layout; a lightbulb book shows you how-to.

Charles Wyke-Smith’s Stylin’ With CSS: A Designer’s Guide is a great lightbulb book, partly because it is clearly and entertainingly written, but mainly because it tells ’most everything you need to know about CSS layout—including things many people reading this page “know” but find hard to remember.

For instance, two best practices have emerged for creating three-column layouts in CSS. One method adds a pinch of non-semantic markup to clear the three columns before creating the footer. It’s dirty, but it works. The other method uses the CSS2 :after pseudo-class to insert and hide non-floated content. That one works because browsers like Firefox, Safari, and Opera understand the CSS2 :after pseudo-class while IE/Win, which doesn’t, clears floats by default even though the CSS spec says not to.

There are geeks out there who’ve memorized both techniques and can argue passionately in defense of one or the other, but I am not one of them. Although I am fairly adept at CSS layout, I cannot keep track of all the tricks and hacks—partly because I prefer to think about content and design. (No offense is intended to those for whom CSS is an art form in itself; different strokes.)

If professional CSS expertise required knowing only five or six workarounds, my browser’s bookmarks would fill in for my missing brain cells. But we all know what happens with bookmarks: we soon have so many, it’s like having none at all. I must have compiled at least 100 “important” CSS bookmarks before I gave up on bookmarking as a means of maintaining my coding knowledge.

Stylin’ With CSS is great precisely because it puts together all the knowledge (or close to it) you’d have from bookmarking the most important sites and pages—and it does so while pulling the ideas together in a coherent and readable fashion.

If you’re good at CSS but you can’t keep track of all the little hacks and tricks, this slim book has you covered. Yet it’s equally good for people coming from a print (or Dreamweaver) background, in that it explains CSS progressively and clearly, avoiding the confusing jargon and off-putting, doctrinal ranting that mar some CSS “how-to” books.

Wyke-Smith is not a visionary, but he is a solid writer with a clear understanding of what designers need to know about CSS and in what order they need to learn it. I recommend this book.