Book review: CSS Cookbook

Christopher Schmitt’s CSS cookbook is exactly that: a book full of ‘recipes’ for CSS. Schmitt tackles CSS problems in a straightforward and structured way, ensuring you quickly get to the heart of the solution. Discussions on how he got to his solutions are included as well.

The third edition of the O’Reilly published CSS Cookbook has been updated for Firefox 3, Internet Explorer 8, and Chrome. The book contains all versions of CSS, including CSS 2.1 and CSS 3. Without a doubt, this book belongs in your library if you layout even the most simple site using CSS.

In this book on CSS Christopher Schmitt takes you through a number of projects that most web designers struggle with. The book’s cover says it’s about common problems, but Schmitt does tackle the more arcane as well. The simple things in this book are for example inheritance, still a subject that isn’t clear to many web developers.

The more difficult problems the author covers include text style issues such as baseline settings for text or setting an initial cap to the start of a sentence — the author uses two methods to achieve a result that resembles the drop cap in printed layouts. Forms are another topic the CSS Cookbook covers. Forms usually get programmed with tables because that’s the easiest to make certain the fields and cells will be positioned correctly, but the CSS Cookbook shows you how to do it with CSS.

More importantly, the author doesn’t shy away of including JavaScript examples in the book. For example, to make a submit-only-once button the author explains which JavaScript you’ll need and how this script snippet will influence a CSS style so you’ll get to the desired results.

Of course, the usual hacks and workarounds to make CSS code all work on all platforms and with every browser, are also present.

Even the most difficult to explain workarounds are only an example away. Table styling, for example, involves padding and margin settings, two of the most messed up properties in a whole range of web browsers on the Windows platform. Although it takes him two pages to explain what is going on, Schmitt does succeed to clarify why you should use the CSS code he proposes to get it right in all browsers.

It’s all explained in a very no-nonsense approach. No frills, no prose, just pure information and CSS code snippets. Throughout the book the same structured approach is applied, and that makes finding back an answer to a problem a no-brainer.

The CSS Cookbook costs 40.00 Euros.