The Basics: CSS (Cascading Style Sheets)

Published 25/05/2004 12:03   |    Updated 28/04/2008 10:58
What do I need to know about CSS?

Developed by the W3C (World Wide Web Consortium), CSS or Cascading Style Sheets are a feature of HTML that offers you, the web designer, greater control over how your web pages are displayed.

 

CSS does pretty much what it says on the tin - allowing designers to create a range of style sheets, or guidelines, that specify how the different elements of your pages, such as the titles, headers, text and links, should appear. (The term cascading is attributable to the fact that you can assign several style sheets to the same web page.)

 

So you're able to easily specify extra formatting such as alternative fonts, colours and layouts and then quickly apply these styles as a set of display rules for any web page.

 

Available via a broadening range of authoring packages, CSS's sophisticated layout and design tools also help reduce page load times without additional 'plug-ins' and expensive tools.

 

Not all web browsers currently support CSS, but that's less of a problem now than in the recent past, as the later versions of Internet Explorer and Netscape are now compatible and more and more browsers are joining them all the time.

 


 

How does CSS work?

If CSS sounds rather similar to HTML, it's because they relate very closely to one another and the distinctions between them can be subtle ones.

 

The essence of the difference between CSS and HTML, is that while HTML concerns itself with both the content of the web page and how it is to be displayed, CSS focuses purely on the appearance of the content and, more specifically, provides a way for the web designer to separate the appearance of web pages from their content.

 

But why is that important?

 

Separating content from how it's presented is really a common sense argument. For one thing, separating the two elements makes the job of web development and maintenance just plain easier.

 

For another, people don't so much look at web sites as use them. Because of this, the content contained in web pages isn't just static text. Interacting and linking to other areas, other sites and even other applications, online content has duties beyond simply being readable.

 

Such content must therefore be considerably more flexible than 'ordinary' flat text and so splitting the content out to make the distinction between what it looks like and what it does makes good sense.

 

As with XHTML, CSS can be a little difficult to grasp at first, so we'll just go over the essentials here, but if you're feeling confident and you'd like to know more right away, you'll find some useful reading at the w3c site.

 

Inside Knowledge

Please be aware that although Cascading Style Sheets is probably the more common usage, the letters CSS are sometimes also used to abbreviate the words cross-site scripting

 

 

« XHTML / HTML differences

 Using CSS »

 

Please tell us how we can make this answer more useful.

Print