Book Review: CSS Cookbook, 2nd Edition
CSS Cookbook, Second Edition, by Christopher Schmitt, O’Reilly Media, 2006.
First things first. You should have some experience with Cascading Style Sheets before diving into this book. It will not teach you CSS, but you will learn some really nifty shortcuts and tricks using CSS. The book assumes its readers “possess some web design or development experience either as a hobbyist, student, or professional.” Take the assumption seriously. But even if you’re an expert at CSS, don’t overlook the book. It should make a handy resource, especially in terms of interoperability.
For those of you who are weak or rusty with CSS, the first chapter provides a good refresher. Go lightly through it, however, since there are some errata which can leave you scratching your head. Most of the errata in the rest of the book is obvious and doesn’t detract from the content, although the typos can be a bit annoying.
The book is structured in a problem-solution format, categorized by type. For instance, “Creating a Hanging Indent,” a handy technique to know, is in the Web Typography section (Chapter 2). It begins with a statement of the problem, “You want to create a hanging indent,” offers a solution (in this case, pretty brief), then goes into a lengthy discussion of the problems, workarounds and related issues (such as, in this case, paired hanging indents). The “problems” range from fairly simple and obvious to complex, using javascript. I should probably note that there is very little explanation of the javascript when it is included in solutions or discussions. The assumption is that you already have some knowledge about it. I should probably also note that when javascript is included, there are instructions on where to obtain the needed code, and how to include it.
Many of the solutions also include using images. Again, there is the assumption you know how to create or modify the image needed. Like the solutions using javascript, the instructions typically tell you where to get the needed image. But some, like the “Rounding Corners” techniques, tell you to create a rounded corners design, then tell you how to modify it for the solution.
On the issue of cross-browser compatibility, there is a very handy section (Chapter 11) on Hacks, Workarounds, and Troubleshooting, and a section in the index with tables showing the implementation of CSS elements in different platforms and browsers (also available from O’Reilly Media as a pdf file). But compatibility issues, if there are any, are also dealt with in each problem-solution set. IE 7 is also included in the discussions.
On the whole, except for the typos and errata (which, unfortunately, were not listed on O’Reilly’s site at the time of this writing), this is a good, solid reference book. I like the discussion part of the solutions, which not only explain the how and why, but often give alternatives and discuss issues which impact implementing the solution (such as validation, and compatibility). While not a book to start out with, it is definitely a book to expand your knowledge and skills.