First page Back Continue Last page Graphics
Cascading Style Sheets
Cascading Style Sheets (CSS) were established by the World Wide Web Consortium (W3C). The CSS specification allows for more control over the look, or style, of web pages or other XML files by providing a central location, or sheet, where you can define how certain HTML (Hyper-Text Markup Language) or XML (eXtensible Markup Language) tags are going to be interpreted by the browser.
Why is it called “cascading”? In CSS, multiple styles can be applied to a particular document (usually a web page or XML file). The browser will interpret these styles in a cascading fashion:
- Style rules set up site-wide are overridden by styles located within individual pages.
- Individual pages are overridden by styles inside an individual tag.
- In addition, the end user can set up styles in the browser that will override the author’s styles.
- All matching rules for a particular selector will be applied, except where they conflict with each other (in which case, the latter rule would be applied, as determined by the cascade). In the following example, <h2> tags would be displayed in red and italics (but not blue):
- h2 {font-style: italic;}
- h2 {color: darkblue;}
- h2 {color: red;}