CSS brings markup to life. That was basically the idea behind Cascading Style Sheets when they where first proposed in the mid-1990's as a way of separating the content of a page from how it was displayed; This was at a time when certain browsers (especially Netscape) was adding more display-orientated tags to its version of HTML. The book starts with the basics, providea examples divided up into chapters on images, forms and lists, plus two chapters on getting around various browser bugs and then wrap up with two complete case studies.
The first chapter covers how CSS works. This includes how cascading affects how rules are interpreted, the !important keyword, as well as some tips on how to organize, compress and style sheets as well as mentioning how Apache's gzip compression can help out. There is a lot of basics here that, yes, might require reading more than once to understand, but are really important to understand how to write good, compact CSS code. The section on selectors is probably also helpful if you find yourself using the jQuery library later- the way it selects markup to operate on is the same.
Chapter two covers the box model, Internet Explorer's unique interpretation of it, positioning, clearing add other bits on how elements are displayed on the page. What readers won't find in this book is any coverage of CSS3 or HTML5- and that's maybe just as well. Today it seems like while pretty much everything that isn't Internet Explorer is supporting these emerging standards in some fashion. However, for now coders using CSS3 are finding they have to repeat almost the same code three times with browser-specific prefix before each CSS3 attribute, plus the proposed "official" syntax and there's the too-familiar grey area between what different browser engines say they support and how they implement them.
After the first two chapters the book looks at how to work with images, lists and forms, providing background information and practical examples on how to create specific effects. Chapter three looks at background images and image replacement, including the four popular methods for replacing search-engine friendly and accessible text with more stylized images. Creating rounded cornered boxes and drop shadows are also demonstrated.
Chapter four and five cover styling lists to create attractive-looking interface elements. Chapter four covers styling links by adding graphics to them and creating navigation bars Chapter five covers lists and creating navigation bars, tabbed interfaces and fancy image maps, much like the ones found at Flickr and Facebook.
Chapter eight is called "Hacks and Filters" and, as the title might suggest, this is on getting around how various browser bugs and oddities- and occasionally using those oddities to make something work for you. Examples include Internet Explorer's proprietary conditional comments or actual parsing errors to import styles. Personally I'm not a big fan of relying on parsing bugs -- bugs, after all, eventually might get fixed -- but if you really need to get something working on, say, Internet Explorer for Mac, it makes sense. On the other hand, some of the bugs might be good to be aware of in case you accidentally run into them. This is a very useful chapter even if you think you know enough CSS; CSS is a standard, how it's been (mis)implemented over the years is a whole other story!
The book is not perfect. As some reviews have mentioned, there are a number of errors in the 1st edition, the Friends of Ed site has a link to corrections. Advanced developers might see a few things missing to; for instance there isn't much on caching (such as Apache's gzip or ETags support) or some utilities both off-line and on-line for compressing files, like Yahoo's CSS compressor that are important for production websites, but then again, maybe these are more a server issue than a CSS issue, as well as the aforementioned lack of CSS3 coverage which is probably for the best until things settle-down a bit more.
That said this book is still one of those most web developers could learn a lot from. The book's layout reminds me a bit of Dan Cederholm's Web Standards Solutions, another Friends of Ed book from a few years back that impressed me with its clear style. The material is clearly explained and the examples are well put together. Recommended.
Published: 25th January, 2010