Thoughts on branding, design, writing and life by Kevin Potts. Established 2003.

CSS Mastery: Advanced Web Standards Solutions

Andy Budd, with the help of Cameron Moll and Simon Collison, has written the book CSS experts have been waiting for: a handbook dedicated to the dark roads and slippery slopes of advanced CSS. Every page is packed with sophisticated techniques and incredibly useful information, making for a valuable addition to your bookshelf.

Let’s face it. There are a lot of books about CSS. Many of them focus on beginners, more of them focus on intermediates, some focus on those moving away from tables, others appeal to visual designers. Regardless, they all spend too much time with background info and simple examples to get up to speed, and then fall short in the meat of the content. Those with advanced CSS skills — like myself — are inevitably disappointed at the lack of sophisticated techniques.

For those nodding your heads, CSS Mastery is for you. This book delivers on its title, and contains page after page of higher techniques, some of them complex, some of them head-slappingly simple.

Andy Budd, the primary writer, only spends one chapter reviewing the basics, but even here he is talking about DOCTYPE switching, specificity and attribute selectors — topics clearly aimed at someone who’s been in the trenches awhile.

Chapter two dives right into layouts with CSS, and we are immersed in margin collapsing, box models and different positioning models like relative, absolute and fixed, each treated with a clear explanation and clean, easy-to-read supporting diagrams. Without switching gears, Andy moves right into floats and the clearing of. Chapter seven covers CSS layouts, and how to create fixed, fluid and elastic structures. Between these two, almost any question you have on CSS-based structures will be answered.

Chapter three covers background images and image replacement, and we are treated with a tutorial on rounded corners and a healthy run-down of various image replacement techniques, including sIFR. Chapters four and five center on links and navigation, and are jam-packed with advanced tips, including an excellent tutorial on creating a CSS-based image map like Flickr’s photo annotation tool. Chapter six covers forms and tables, and while not breaking any new ground, lays out best practices for those interested.

Chapter eight wades into deeper water: “Hacks and Filters.” Here Andy Budd really flexes his knowledge, describing the tangled web of CSS hacks and workarounds and the advantages and shortcomings of each. Tantek’s band pass filters are examined, as are a myriad of other hacks: child selector, attribute selector, star HTML, commented backslash, escaped property, box model and more. Each solves a unique problem, and Andy makes it clear which ones are recommended.

“Bugs and Bug Fixing” is the title of the ninth chapter, and along with the usual recommendations (check your validation, color your backgrounds, etc), there is a fascinating discussion about IE’s “layout” issue, and how elements given “layout” don’t cooperate with other floated elements. Andy also covers more layout bugs and appropriate workarounds: the double margin bug, the duplicate character bug and more.

Chapters ten and eleven are case studies, built by Simon Collison and Cameron Moll, respectively. The step-by-step page building is covered in great detail, and more advanced techniques are revealed. Of particular interest is Cameron’s technique in resolving IE’s failure to understand min-width and max-width: a simple JavaScript expression (that he later corrected).

Throughout the book, Andy’s writing is clear, concise and authoritative: you get the sense that his editor had an easy job. There is little fat on this beast. Page after page is overflowing with techniques, practical advice and clever diagrams, and there is something in here for every CSS designer out there.

I consider myself a CSS expert — not quite a ninja like Tantak or Meyer — but able to code an entire design without peeking at a reference. CSS Mastery is the only book I’ve found that expanded my horizons. I’ve noted and stickied almost twenty pages, from the CSS image map to the IE 6 duplicate character bug. It is a valuable reference in the truest sense of the word — I expect to be referring to it often enough that I doubt it will find its way to the bookshelf anytime soon.

, , , , ,

commentary + criticism


wrote the following on Tuesday June 27, 2006

Sounds like a terrific book. Would you say that you need to be a CSS expert to “get” this book, or is an intermediate understanding of CSS acceptable?

Andy Budd

wrote the following on Tuesday June 27, 2006

Wow, thanks for the great review. I feel I owe you a beer or two for that one :-)

Nathan Smith

wrote the following on Tuesday June 27, 2006

To answer Shane’s question – No, you don’t need to be an expert. This book helps to fill in the cracks in one’s understanding of CSS. By the time you finish reading it, I guarantee you’ll have learned quite a bit of new information. It is written in such a way that anyone can pick it up and jump right in. I hope that answers your question.


wrote the following on Wednesday June 28, 2006

Yes, I agree with Nathan. The book is packed with more advanced techniques, but anybody with a fundamental understanding of CSS can pick it right up. In fact, the chapters on positioning and layout should help anyone get their footing when creating tableless designs.