The use of
Cascading Style Sheets (
CSS) is mandatory to ensure a uniform style, formatting, and positioning to all website pages of the government websites.
- Government websites must use cascading style sheets as much as possible to control layouts/styles.
- CSS must be included in external files allowing global changes to be propagated across all pages seamlessly.
- Government websites must remain useful even if style sheets are not available.
- Page elements logical order must be independent from cascading style sheets.
- Font size units used throughout the CSS should be relative rather than absolute, to allow for better display when the text size is increased using the browser settings.
Example:
Use em to set font sizes, as in:
H1 { font-size: 2em }
rather than:
H1 { font-size: 12pt }
- CSS selectors naming should be consistent.
- A print CSS file must be provided to allow for better layout of printed web pages.
- CSS files must be tested for compliance using a tool such as W3C CSS Validation Service.