XML technologies / CSS / Advanced websites with CSS / Adding some color / Who is really in control?
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
Under the CSS2 standard, users’ local browser preferences generally override the style rules and HTML attributes supplied by a website. Although it is important to remember this, knowing it does not tell us how to design a page.
How can we achieve an optimal appearance without considering user settings? We cannot!
Figure: Firefox browser menu for changing color settings.
Setting your own browser design preferences is easy. All newer versions provide simple menus for choosing default colors and fonts, as the two Firefox figures illustrate.
In the browser’s dialog, users can choose colors for page text, backgrounds, visited links and unvisited links. The dialog in the lower figure sets defaults for serif, sans-serif and fixed-width fonts. Both dialogs let users override the page’s design defaults with their own preferred values.
Figure: Firefox browser menu for changing font settings.
Many browsers even allow a local stylesheet that automatically overrides all stylesheets from incoming pages, invalidating the entire design.
Imagine a user defines the following style rule:
h1 {
background-color: black;
color: white;
}Now imagine that user opens a page with this stylesheet:
h1 {
background-color: yellow;
color: black;
font-family: Helvetica, Arial, sans-serif;
}The font remains unchanged, but the page and background colors are overridden by the user’s settings.
Strictly speaking, every style rule, property and value in this book should be followed by: “Applies only if the user’s preferences do not specify otherwise.” Let that be stated once here and apply everywhere. I will not bore you by constantly repeating this rule throughout the rest of the book.
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