Designer at work

css

There has been a revolution in webpage design over the last few years. The name of the revolution is CSS (Cascading Style Sheet).

In the beginning designers used a combination of table tags and font tags to style their webpages. With the result that there was a lot of work involved in redesign when the need arose. Every single page had to be changed.

CSS separates the structure of a web page from its presentation. The structure is that part of a webpage that tells the browser - this is a heading, this is alist and this is a paragrpah, and so on. The presentation is that part that says this heading is so big, and is this colour, and has this much space below it, and so on.

By separating the two features of a web page, it was possible to put all the presentation information in one file (and call it a stylesheet) and to link from the web page to the stylesheet.

<link rel="stylesheet" type="text/css" href="styles.css">

A line like this is put into the head section of the web page. Then the web page is written with minimal markup because the 'decorative' aspects of the page are in the stylesheet.

Some of the advantages of using stylesheets:

It should be noted that even though the CSS rules are standardised by the W3C, the browsers do not always interpret the rules in the same way. This results in what are called 'hacks' being applied to CSS rules to force browsers to display the rules in the same way.