Using stylesheets

Documents should be organized so they are readable without a style sheet.

Organize documents so they may be read without style sheets. When content is organized logically, it will be rendered in a meaningful order even when style sheets are turned off or not supported.

Style sheets may be used for color, indentation and other presentation effects, but the document should still be understandable (even if less visually appealing) when the style sheet is turned off.

If you use a style sheet, ensure that the important content appears in the documents that use the style sheet. Text generated by style sheets is not part of the document source and will not be available to assistive technologies that access content through the Document Object Model Level 1 (DOM1). Provide a text equivalent for any important image or text generated by style sheets (e.g., via the 'background-image', 'list-style', or 'content' properties).

If designers set up their pages to override user-defined style sheets, people with disabilities may not be able to use those pages. Therefore, designers must ensure that their web pages do not interfere with user-defined style sheets.

In general, the "safest" and most useful form of style sheets are "external" style sheets, in which the style rules are set up in a separate file. Example of source code:

You may also want to create an alternate external style sheet for your page that allows the user to view the page in larger text. This style sheet will be used as an alternate to the default style sheet, and can be coded in the following way:

For information on creating alternate styles sheets, please see the following articles by Paul Sowden. This article informed the style sheets on the CWRL site.

For information on CSS2 techniques for generating content from style sheets, you can go to the World Wide Web Consortium's Guidelines for Generated Content.

For information on using CSS properties to specify border styles, see the World Wide Web Consortium's Guidelines for Rules and Borders.