easy guide to styling web pages
We all know that cascading style sheets (CSS) is the way to go for web designers. It helps to separate style from content, and you can change the appearance, font, or layout of an entire website with just one tweak of style sheet code. But how d’you do it, and what’s the best way of controlling the appearance of your web pages? David McFarland’s new book CSS – The Missing Manual starts out by listing all the reasons you should wean yourself away from those old HTML habits and explaining why XHTML and the use of style sheets is more efficient. He explains inline and external stylesheets then very gradually shows you how to create one.
I still find it difficult to get my head round the abstract language of styles (declaration, selector, property, and value) but he spells it out as clearly as possible. But the best part about his approach is that he is systematic, detailed, and very straightforward. Each stage in the process is illustrated with a screenshot – though I think the use of colour printing would have helped. Then it’s on to class selectors, plus divs and spans for creating special effects
After that he moves on to discuss basic formatting – how to adjust the appearance of text on the screen. And i couldn’t help thinking that this should have come earlier. Almost any beginner I can imagine would first of all want to learn how to affect the appearance of text on the page, beforedealing with more complex issues such as ‘cascade inheritance’. So if you’re just starting out, jump straight to chapter six.
The good thing is that he shows you every step of the way: what to type in as CSS code; how to create the effect you need; refresh the browser – and, hey presto! – there it is on screen.
Another thing I like about this series is that all along the learning route they list software which is available as free download to perform the tasks that you need.
© Roy Johnson 2009
David McFarland, CSS: the Missing Manual, Sebastopol, CA: O’Reilly, 2009, pp. 560, ISBN: 0596802447