When Written: June 2000
Verdict: A ‘must have’ reference book that can and should be read by anyone involved in HTML page development.
Author: Eric A.Meyer
Imagine the scenario: You are responsible for the company website which has now grown to several hundred pages. The directors have decided that it needs tiding up and a coherent style applied to all the pages, but they are not sure what would look the best so could they see the site with different styles applied to it. You could create multiple copies of the site, after all hard disc space is cheap nowadays, and then do a search and replace on all the pages to apply the changes, or if you are lucky and are using a proper design tool you could just alter the many templates and then update the site, or you could resign.
However there is a fourth solution which may have escaped you notice until now, and that is to design the site with Cascading Style Sheets (CSS). These have been implemented since version 3 of the browsers but in real terms it was only in version 4 and after that the browsers started to render the pages with CSS properly. Even now they can give rise to inconsistencies and testing in the various browsers is, as always, recommended. Interestingly, Opera, the small kid on the block, handles CSS better than the offerings from the big boys.
Understanding CSS is a bit of a black art with many pitfalls, so any help is appreciated. When ‘Cascading Style Sheets, the definitive guide’ fell on to my desk the other day, I immediately picked it up and started reading. The Book is one in the fantastic range of IT books by O’Reilly, you know, the ones with black and white line drawings of animals on the front which bear little or no significance to the contents of the book!
This one is written by Eric A Meyer and according to the preface, the book is his first major writing project. He can be congratulated on the job, as the style is immensely readable and the technology becomes understandable. Very useful is where the browser inconsistencies are pointed out where ever possible. The text is regularly interspersed with code samples along with examples of expected screen output, although, as the code examples are often about colour changes to text and the example outputs are reproduced in black and white , a little imagination is required at times! In fact the interpretation by browsers of positioning commands is so problematical that the author has opted for ‘mocking up’ the screen shots in PhotoShop to show what the pages should look like because as the author says in this chapter “…the reliability and consistency of positioning implementations ……not one of them was solid enough to trust completely”.
With all these problems you may be wondering why bother with a book on the subject at all ? Normally with a bit of technology the best way to get familiar with it is to ‘roll you sleeves up’ and try it, however in the case of CSS so much is not implemented that the first reaction is to bypass it altogether. This is a pity because parts of the implemented CSS specification are so useful that it really is worth while spending the time to get familiar with it, and to have someone who has done a lot of the hard work for you, pointing out the pitfalls in a well set out book, is worth hours of your time and will easily repay for itself.
CSS 2 is covered in a section of its own because, as the author says, although it is a full ratified W3C specification very little has been implemented. The chapter is included to show more what the future will hold in this area rather than being of use today.
At the back of the book there is a very useful Tips & Tricks section, along with a lesson in converting a printed page to a CSS web page. Also to be found at the back is a full list of CSS Properties, and perhaps most useful of all a support chart which does not list contacts of help groups you might need after trying to get CSS to work but rather several pages of tables showing what properties of CSS are supported by IE 3, 4, 5 Netscape 4 and Opera 3 on Windows and Macintosh platforms. Obviously the author has done a lot of hard work here and should be congratulated on a great ‘must have’ reference book that can and should be read by anyone involved in HTML page development.
Article by: Mark Newton
Published in: Mark Newton