Book Review: CSS: The Missing Manual

I’m the kind of person that likes to learn by doing.

CSS: THe Missing Manual

The first time I touched any CSS code it was out of necessity.  Being used to the old-school style of HTML, using tables and attributes for layout and color, I was trying in vain to alter a Joomla template I was working with by just editing the HTML.  (Part of the problem, in retrospect, was that the template in question was a weird hybrid of table-based layout and CSS-based colors and images – but I digress.)  Eventually I realized it was the .css file that I had to play with, and after several hours of experimenting and tweaking, I had sort-of figured out how descendant selectors and classes and ids worked.  Sort of.  I got the results I wanted, but not in the most graceful way possible by far, and without a complete understanding of how I did it.

So when I recently decided to take my career towards web design as a profession, I knew I had to brush up my knowledge in certain key areas, starting with XHTML and CSS.

Enter CSS: The Missing Manual by David Sawyer McFarland.  The book starts out with a short review of (X)HTML, explaining how and why modern HTML is different than it used to be.  More than just a list of changes, this opening section is a mini-treatise on the modern concept of separating the structure “layer” of a web document from the presentation “layer”.

From there, the book goes on to explain in a very readable manner the basics of internal and external stylesheets, and inline style declarations and why they’re usually best avoided.  Also extremely helpful is the explanation of “the cascade” and how it works.  This information, while it may seem boring and bookish in other presentations of the same material, is essential in understanding why sometimes you write a style that should work but nothing happens.  This is often caused by precedence rules according to the cascade.

The meat of the book follows, and of course it entails thorough treatments of every HTML element you’d ever want or need to style, ending with a substantial section of the book devoted to page layout techniques.

But the best part of the book has to be the inclusion of the tutorials.  As I said above, I learn best by doing, and this book is set up for just that.  There’s a set of files you can download from the book’s website to work with as you go through the books tutorials.  Each chapter has two parts: first, an introduction to the topic; and second, a tutorial where you can follow along and see the concepts in action.  It’s a great way to get used to typing the code so that the syntax becomes second-nature.  And, if you’re anything like me, you’ll find yourself continuing to tweak and add and subtract the styles after the tutorial’s over, just to see what happens and deepen the understanding.

Overall, highly recommended.  The book lives up to its name.  In fact, I enjoyed it so much (and felt I learned so much from it) that I bought the Javascript book in the same series, which focuses on immediately applicable Javascript techniques using the popular jQuery library.  I can’t wait to get started. :)