Separating Content from Presentation
Cascading Style Sheets
- CSS is a standard layout language for the Web. CSS controls colors, typography, and the size and placement of elements and images.
- CSS is bandwidth-friendly technology: a single 10K CSS document can control the appearance of an entire website, comprising thousands of pages and hundreds of megabytes.
- CSS is intended by its creators (W3C) to replace HTML table-based layouts, frames, and other presentational coding.
- CSS, together with other web standards such as XHTML, helps separate style from content, making the Web more accessible.
- Style sheets make it easier to maintain and update web sites. One change in a style sheet can change a presentational element such as text color for an entire web site.
- A document needs to be understandable with its style sheet turned off. Style sheets are an asset to accessibility but they are ignored by assistive technology so it is important not to convey information with style sheets.
Controlling Presentation with Style Sheets
Presentation elements that should be controlled through style sheets
- Body elements such as background color
- Text font, color, size
- List layouts -- format of bullets, removal of bullets, indentation
- Format of Headings -- font, color, size
- Format of hyperlinks -- color, underlining, font
- Margins
