Tuesday, December 9, 2008

Cascading Style Sheets (CSS)

Cascading Style Sheets (CSS) give the author of an HTML page the ability to separate the styling elements from the content of a document. They are of fundamental importance to the usability of a page for everyone. They are simple to implement and extremely powerful. Their use should be controlled centrally by the organisation’s Web manager and should set the formatting standards for the entire organisation.

Use each checklist to ensure that your web pages comply with these guidelines

Core guidance

Checklist

* All documents using CSS for formatting must be usable when CSS is disabled
* Management of CSS formatting should be centralised using an external CSS file
* Care should be taken when using CSS absolute and relative positioning to ensure that content remains presented in the correct order in browsers that do not implement CSS positioning
* All Cascading Style Sheets should be validated by W3C

Summary

Although Cascading Style Sheets use a slightly different language to that of HTML they are quite easy to master. When appropriate, web managers should ensure that the organisation’s website is consistently formatted using this technique.


Introduction

Until a few years ago all HTML documents were a mixture of content plus structural and styling markup elements. When viewed the source code looked complicated and cluttered. This clutter could make it difficult to actually see the data amongst all of the mark up information. These elements not only got in the way when the information was viewed and edited but could also cause many usability issues for non-graphical browsers and screen readers.

With the advent of Cascading Style Sheets the Web manager now has the ability to separate styling instructions from the entire page content and structure.

Any element within an HTML page can be referred to as an object - a word, an image or a style of formatting. Using CSS the Web manager can name these objects and assign a particular style to them. These styling elements can be for the formatting of a page or the font style of all text, but they can also be used to format an individual line or word.

There are three main ways in which CSS can be implemented in an HTML document:

* in-line styles;
* style sheet at the top of each document; or
* an external style file.

Each of these works in exactly the same way and all use the same syntax.

0 comments: