XML technologies / CSS / CSS Cookbook / Typography for the web / Setting your own font sizes
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
Problem
You want to override user-defined font sizes with your own values.
Solution
Use an !important rule to override the values in the user stylesheet:
p {bn
font-size: 12px !important;
}Discussion
An !important rule consists of an exclamation mark (!) immediately followed by the word important.
Some browsers let users specify a stylesheet with their preferred font sizes and other CSS properties. As the document’s designer, however, you want your designs to appear as planned. The !important rule provides a little insurance that your designs remain intact. (Remember, though, that the nature of the medium prevents absolutely precise or pixel-perfect designs.)
Using !important rules does not guarantee that a browser will use your design, because users can include them in their own stylesheets. User-defined !important rules take precedence over the designer’s rules.
See also
The CSS 2.1 specification on !important rules.
Copyright of the German edition © 2007 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “CSS Kochbuch” 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.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln