Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Related items

An Introduction to Cascading Style Sheets

Dynamic StyleSheets

Why use CSS?

You are here: irt.org | Articles | Cascading Style Sheets (CSS) | Why use CSS? [ previous next ]

Published on: Sunday 29th November 1998 By: Janus Boye

Introduction

Here at irt.org, we've had a CSS FAQ since February, and we've had an Introduction to CSS since May. The very first CSS specification came out way back in December 1996, so Cascading Style Sheets is happening.

It is no longer a new emerging technology. It is being used on more and more web sites, and more and more users are using a browser that knows and understands better and better CSS.

But why? Why are people using CSS? In this short article, I'll try to answer this, with a listing of some of the many benefits and drawbacks, that CSS brings to the Web community.

Separating style from content

The main benefit in CSS, is that it manages to separate the style from the content on your web page. If you are used to using HTML, you'll have noticed, that HTML can do both style and content. With a FONT-tag, and some artistic sense, you can make a HTML page quite stylish.

What CSS does, is that it handles the style of your web page, and lets HTML do the content. Why is this good?

First of all, the stylish capabilities in HTML are quite limited. Secondly, with the use of an external style sheet, you are able to alter you entire site style, by only editing one single file!

As an example of the above, let's say you wanted to change your site from using Times New Roman to Arial. With 'old-fashioned' HTML, you would have to alter the FONT tag, on each and every page. With CSS, you would just need to alter the style sheet, and then all pages would be using Arial.

Even though trends are towards decentralization, you actually make things easier, more efficient, and save time, by centralizing your style into one single style sheet.

Improved usability

If you started using style sheets extensively, your site would automatically become more usable.

By removing all nasty BODY-attributes and font tags et. al. from your HTML pages, and moving these into a nice single external style sheet, your HTML pages will turn smaller in size, and the style sheet would only need to be downloaded once (as further requests would later be taken from the users cache), and thus your site would load faster.

With the use of CSS, it's also important to remember that unlike other nice web technologies (e.g. ActiveX, JavaScript, VBScript etc.), your users do not loose functionality, if their chosen browser does not support CSS. They will simply just get plain text -- your raw content.

Also remembering that the FONT-tag, and many BODY-attributes are browser specific your site also becomes more easier to read and understand for browsers.

The capabilities of CSS also allows you to make your site usable for the blind. Your web site will be able to actually talk to your users! If you want to learn more about Aural CSS, you can take a look in the Aural CSS FAQ.

A costly technology?

One of the problems of CSS is, that if you want your site to have the very same look and feel, in as many browsers as possible (e.g. both NN3+ and IE3+), you will not be able to remove the style from the HTML code, as among many browsers NN3 does not support CSS -- actually it has never heard of it -- also IE3 only supports very few parts of it.

This means that you would have to carry on with your existing code, and thus using CSS would very likely be an extra burden on your budget.

You could use CSS for users with CSS capable browsers, and then keep 'old' style tricks (as the 1 pixel wide transparent gif) for all the other users. Your style sheets would then just be another place to look after, when your site style needed an update.

The above problem gets even further complicated, when you consider that CSS2 -- the update to CSS1 -- is now available. CSS2 extends CSS1 and newer browsers will definitely support CSS2 (more or less). The problem is that all the browser vendors seem to have agreed to disagree on which tags they support. So to do things perfectly you would need to know exactly how little CSS is supported in IE3 and exactly how much is supported in NN4.5 etc.

On intranets, where you might only have to design for one specific browser you naturally do not have this problem.

Lowest Common Denominator

On the Web, there seems to be a thing called designing for the lowest common denominator. Back when the dinosaurs ruled the world it was HTML2.0. Now it might be HTML3.2 or HTML4.0.

CSS brings so many advantages to the Web, and also to you as a user, and to you as a web designer, that you should not hesitate using it immediately.

Perhaps CSS is still not a part of the lowest common denominator when you design sites, but using it will help you so much, and save you so much time that you should go right ahead and use it.

Good luck!

Useful resources

Related items

An Introduction to Cascading Style Sheets

Dynamic StyleSheets

Feedback on 'Why use CSS?'

©2018 Martin Webb