Style Sheets without tears by Joe Gillespie

by Joe Gillespie — Apr 1, 2002

Taking a sneak-peek behind the scenes at some popular Web sites shows me that the dreaded <font> tag is still alive and kicking.

It's strange, considering that it has been on 'death-row' for some time and is liable to be banished from new browsers any day now.

Well, come to think of it, maybe it's not so strange after all. The preferred alternative, the 'Cascading Style Sheet', is not as easy to use or as reliable as it should be. If you want to use a particular font in a word processor or DTP program, you just highlight the text, go to the font menu and choose from the list – and that's it. You can also set the type size in points and choose from a number of different styles like 'bold' or 'italic' with a few mouse-clicks. After a while, you have a pretty good idea what you are going to get.

Most current WYSIWYG Web page editors let you do something similar but in doing so, apply the <font> tag along with <font size> and <font color>, <b> and <i>. Well, it is easy, and not exactly illegal, so people carry on regardless.

Although they do support cascading style sheets, somewhere, you have to dig around to find it and when you do, it is all very confusing. Why does it all have to be so difficult?

Considering the many advantages of using style sheets over <font> tags, you would think that they would go away and die quietly - but not so. It seems that the advantages of using style sheets are outweighed, in part, by the disadvantages.

Yes, there are disadvantages to using style sheets. Compared to making simple font choices in other programs, they are considerably more complicated to implement and if you never look 'behind the scenes' at a Web page's source code, can be quite hard to grasp initially. If you add to that the fact that they don't solve all the problems that you think they should and introduce a few more of their own, you might well ask yourself, "Why bother?"

If you have moved to Web design from more traditional areas, you will be aware that, on a Web pages, you don't have a near-infinite choice of fonts and typestyles and the ability to place them wherever you want and at any angle. You are stuck with using a few 'common' fonts that are available on every computer. Bor-ing!

Then somebody comes along and drops the bombshell that, despite your efforts, other people will probably still see another font and at a different size from what you intended! In fact, the more savvy you are with the minutiae of typographic finesse, the more frustrating it is. Even the latest CSS specs give little more typographic control than an ancient typewriter - without the tab key!

For better or worse, CSS2 is the best we have at the minute and we have to make the best we can of it. Rather than fight it, it is better to use it. Like anything else, the more you understand it, the better chance you have of getting decent results.

So, the principle is that you keep the structure (HTML) and the style (CSS) completely separate so that they can be mixed 'n' matched. That is why the <font> tag, and its entourage, really has to go. Digg Technorati Blinklist Furl reddit Design Float