MSc-IT Study Material
June 2010 Edition

Computer Science Department, University of Cape Town

Advantages of Style Sheets

  1. Multiple Styles - A single document can be presented in multiple styles by using multiple style sheets.

  2. Re-styling - The use of style sheets (which are separate to the HTML files) allows the quick re-styling of any document, without modifying the original HTML.

  3. Document maintenance - The ability to re-style many documents allows us to easily make changes to the appearance of many Web pages without separately editing each one.

  4. Consistency - Style sheets guarantee consistency throughout website.

  5. Optimal file size - The smaller the files the faster the download. Using style sheets can help minimize file sizes, since, for example, every < font > tag, is defined in one place in a style sheet, rather than in multiple places in the HTML file.

  6. Style and structure - When first developed, HTML was only concerned with document markup and not with the document's formatting. This eventually changed, with more and more functionality being added to HTML to allow for formatting. With the introduction of style sheets, the HTML document is again concerned only with structural document markup — all formatting is now placed in the style sheet.

Exercise 1

Visit the UCT Computer Science Department website and suggest how the above advantages of style sheets can be used. You can find some discussion on this at the end of this chapter.