Skip to main content

Cascading Style Sheets

HTML was designed to describe the structure and function of elements on a Web page (paragraphs, headings, tables etc.); it wasn't designed to control the appearance of the Web page - although it does have some basic formatting attributes (background colour, font type, font size and alignment).

HTML has developed over the years to accommodated users' requirements to be able to control the presentation to their Web pages rather than leaving the end result to a Browser, by adding typographical controls (for example font styles and sizes) to a Web page. These, of course, add to the size of the file and also to its maintainability - imagine having a large Web site of a few hundred pages and someone decides to change the font style from a serif (e.g. Times) to a san serif (e.g. Arial) type face.

In 1996, W3C recommended the idea of Cascading Style Sheets (CSS) to control the format of Web documents and to separate structure and format.

A style sheet gives the user several benefits:

  • better control over layout

  • better control over text display

  • separate form from structure

  • better site maintainability

  • smaller Web pages which means faster downloads.