XML technologies / CSS / Advanced websites with CSS / A first overview / What is CSS really?
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
Having explained at length how CSS frees us from the drudgery of table-based page layouts, let us now examine it closely.
The most important part of the name Cascading Stylesheets is the beginning of its second word: Style, meaning style. Cascading (cascading) comes into play only in more complex CSS usage, and Sheets (sheets) become fully relevant only with more advanced applications. For now, rather than focusing on the cascading or sheet-like nature of stylesheets, we will consider their role in building pages and websites. Instructions for presenting HTML elements, called styles in CSS, are defined as rules . These tell a CSS-capable web browser how to display particular content. We call this process of making content visible rendering.
To understand how style rules affect page presentation, first consider what happens to a web page without them.
Figure: Normal browser rendering without CSS.
The figure above shows the usual interaction between a client, the web browser, and a server hosting a web page. Unless instructed otherwise, the browser decides how to present the server’s information to the user. Each browser has its own defaults. For example, a level-one heading written between the elements <h1> and </h1> always appears in relatively large black type. The default font can vary between browsers and can also be affected by user preferences.
The following figure shows what happens when a style rule exists for a particular part of the HTML structure. The rule overrides the browser’s defaults for that element, and its style instructions control the presentation. Even the user’s own browser preferences for this element do not apply, though there are exceptions we will discuss later.
Figure: Browser rendering with a style rule applied.
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg
back to top