Photo of Walt Whitman, year 1854

Wander

Technology

CSS Cookbook

by Christopher Schmitt
O'Reilly Media, 2004
Paperback, 252 pages, $ 34.95
ISBN: 0-596-00576-8

Reviewed by Michael Pastore

When I opened up CSS Cookbook I expected to find a collection of recipes to spice up my bland web pages with great-looking styles. The Cookbook met that expectation, and provided another unexpected benefit. In sections called "Discussion," the author explains the mysterious workings of CSS properties and rules. So after reading a chapter you will not become a mindless automaton who blindly follows intructions without understanding 'why'. You will learn some of the important principles of Cascading Style Sheets, and ultimately, how to cook up great styles on your own.

The book contains 84 recipes for things that you can do with CSS, organized into ten categories, below. The categories are useful to help you understand how to think about styling your pages, and what CSS can do:

A practical book like CSS cookbook must be evaluated by three simple questions. Does it cover the essential CSS features that everybody needs? Does it introduce me to new CSS features? Are the explanations easy to follow, or will I need a strong coffee and the Wikipedia to explain what I've just read?

About the CSS essentials, this book has it all. Chapter 7, on Page Layouts, explains the way to set up your pages with 1, 2, or multiple columns. Chapter 8 helped me to design my first printer-friendly web page, complete with a tip for showing URLs when the page prints. Chapter 1 will teach you 19 tricks about Web Typography, including the ever-useful "pullquote", for highlighting information on a page. And bravo for the book's explanation of the one hardest-to-grasp aspects of CSS -- the notorious "box model" -- which appears exactly where you need it: near the opening of the book, on page 3.

CSS Cookbook showed me some new tricks, too. Coverage was excellent about 'How to center elements on a page' -- which is not intuitively obvious, or possible to figure out on your own. A cookbook, of course, should have something to say about menus, and this one teaches how to make elegant menus, horizontal, vertical, or tabbed. The final Chapter 10, Designing With CSS, might have been subtitled "CSS can do THAT!" ... Yes, in addition to its many practical benefits, CSS can make your pages look magnificent. The author writes: "... it's about grabbing the attention of visitors to a website. " The entire chapter illustrates how you can "create maximum impact with minimal resources."

The book never sent me scrambling for Wikipedia; the writing was clear, and the recipes worked the first time out of the box. And the book is easy to read, like other O'Reilly books in the Cookbook series, with lots of white space, big header text, and a special binding that lays open flat without cracking the spine.

The book covers CSS 2.1 (the latest specification), and -- except for a few snacks of JavaScript -- can be used by just about anyone who has a simple working knowledge of CSS. The practical approach, combined with a dash -- but just the right amount -- of theory, makes CSS Cookbook an exceptionally useful reference for learning and doing CSS.

—Michael Pastore


About the Reviewer

Michael Pastore is the Editorial Director of BookLovers Review and Zorba Press. Currently he is writing his fourth novel, and working to establish the Youthtopia Institute and Youthtopia website, devoted to children, creativity and the arts, humanized technology, and a sustainable world.