XML technologies / CSS / Advanced websites with CSS / CSS property reference / font-weight
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property font-weight describes the stroke weight of the font in a text element.
Inherited: yes (For relative measurements, the parent element’s computed value is inherited.)
See also: font
Values
The CSS specification provides the following absolute values for font-weight:
normal(equivalent to400)bold(equivalent to700)100200300400500600700800900
The following relative constants are also valid:
bolderlighter
The starting value for bolder and lighter is the value applying to the parent element.
Default value: normal
Compatibility
CSS version: 1
Works in all CSS-capable browsers.
Most browsers support only the variants normal and bold and replace all other numeric and relative values with one of these variants.
Example
The following rule overrides most browsers’ default stylesheet behaviour, which displays strong elements with the value bold. In browsers supporting several font weights, the elements are displayed with a heavier weight than their parent elements’ text. A strong element inside a heading is therefore displayed with an even heavier weight:
strong {
font-weight: bolder;
}
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