Ecommerce Developer
 
 

APIs & Plug-ins

Book Review: CSS Cookbook 3rd Edition

 

O'Reilly Media recently released the 3rd edition of its popular CSS Cookbook to cover more CSS3, new features of HTML 5, and changes in browser compatibility.

Written by Christopher Schmitt, CSS Cookbook has been around in one edition or another since 2004, and in those six years it has become something of a standard reference guide for new web designers and for freelance or agency-based web developers, who must know and practice several coding disciplines, and, therefore, can occasionally use a basic reference guide.

CSS Cookbook Cover ImageLike most coding cookbooks, CSS Cookbook is arranged in a series of recipes. Each recipe starts with a "problem," includes a "solution," and discusses the solution. Often additional resources—such as supporting web pages, downloadable development tools, or articles—are listed at the end of a recipe.

Page 268 of the text, as an example, is the beginning of the "Resetting Browser-Style Defaults for Elements" recipe. This particular recipe is to be used when "you want to keep browsers from setting values for elements within web pages," or put another way, you want to eliminate the inconsistencies in how different browsers render your page. The solution to this problem, according to Schmitt, is to "use a separate stylesheet that sets all or most of the common HTML elements used in a web document to a value of 0."

CSS 3 Recipes

True to its 3rd edition charter, the book contains several CSS3 recipes, including "Animating Rollovers on Links with CSS3 Transitions," "Setting Images on a Border," and "Replacing HTML Text with an Image."

When CSS3 is used, Schmitt, warns the reader if the technique in view is not supported in all browsers and in some cases offers alternative methods of achieving that same end, some of which don't actually use CSS.

When You Cannot Remember

Often reviewers and critics have said that this book is aimed at novice designers and developers, which to some degree is a fair assessment. For example, the book's recipe for "Changing the Format of a List" on page 299 is very basic CSS that would generally be second nature to a seasoned designer.

With that in mind, more than once I have found myself in need of a little refresher on basic CSS. Certainly, I have many styles down pat, but since I must move back and forth from PHP, to JavaScript, to HTML, to CSS, to writing articles, I often forget a selector or an attribute, and this book has been a real lifesaver.

Specifically, the same very basic recipe about changing list formats includes a bullet styles table. On the rare occasion that I need to use decimals with zeros in front it to number items in a list (i.e., for HTML versions of a white paper or technical document), I can locate the proper style on this bullet style table, which is in this case decimal-leading-zero.

New Skills and Techniques

What's more, I find that I do learn a lot of new techniques browsing through CSS Cookbook. For example, until using this book, I was not aware of the Microformats Project, which provides a standard for coding machine-readable information into an HTML web page.

On page 27, CSS Cookbook includes a helpful recipe for "Creating an HTML vCard (hCard)" that describes how to provide machine-readable contact information in an HTML format.

Summing Up

CSS Cookbook has been around for a while and the new 3rd edition does include new or updated material that might make it worth a look even if you already have an older edition.

If CSS Cookbook is not on your technical bookshelf and you ever find yourself struggling to remember how to change the style on form elements when users click, you'll want to invest the $30 and buy the book.

Related Articles

0 Comments

Rss-sm