From: Pawan R. Vora, Designing Next-Generation Web Sites. Workshop at the 1999 Human Factors
and Ergonomics Society Meeting.
CSS is based on rules and style sheets. A rule is about one stylistic aspect of one or more elements. A style
sheet is one or more rules that apply to an HTML document.
CSS offer the ability to control how content appears on your Web pages. It offers more control over style and
layout with ability to create consistent sites quickly.
Through CSS a designer can describe and control how the text and design elements are displayed on a Web
page, hence the term "style sheets."
Cascading
A fundamental feature of CSS is that more than one style sheet can influence the presentation of a document --
for example, the browser, the designer, the user. This feature is known as cascading because the different style
sheets are thought of coming in a series (Lie and Bos, 1997).
Therefore, the style sheet implemented on a page cascades -- that is, your inline style sheet definition overrides
the embedded style sheet, which in turn overrides the external style sheet. When style sheet definitions conflict,
the most recent definition wins.
Benefits
• Easier management of the Web sites Easier to implement style guide recommendations
• Smaller files (fewer graphics downloads)
• Text doesn't need to be graphics anymore!
• Faster downloads
• Usefulness not only for designing usable sites, but inclusive sites as well.
BODY {
background: #ffffff;
color: #000000;
margin-left: 2em;
margin-top: 2em;
}
</STYLE>
Linked style sheets
You link an external style sheet to the HTML document using the <LINK> tag within the
<HEAD> element
For example,
<LINK REL="STYLE SHEET" HREF="project.css"
TYPE="text/css">
Imported style sheets
For example,
<STYLE>
@import
url (http: / /www.sitename.com/css/project.css)
</STYLE>
CSS Level I
- System Color
- Enables pages to be developed
- To account for a user's preferred look and feel and
- To respond to current user settings, which may be related to a disability (e.g. color-blind
users may have their environment configured to avoid specific colors).
Benefits of CSS
- CSS, in combination with HTML and XML, truly separates content from its presentation.
- Will allow designers to create tighter, more dynamic content for the Web
- Pages using CSS will transfer faster to users and will be easy to maintain
- Will lead to improved accessibility, maintainability and performance on the Web
4.10 Challenges