Difference between revisions of "CSS GUIDE FONT WEIGHT"
m (→Specification Conformance) |
m (→Legal Values) |
||
(One intermediate revision by the same user not shown) | |||
Line 37: | Line 37: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>Boolean Weight</td><td>normal | bold</td><td> | + | <td>Boolean Weight</td><td>normal | bold</td><td>Sets weight to either normal or bold</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 56: | Line 56: | ||
*[http://www.w3.org/TR/CSS1#font-weight CSS 1 ] | *[http://www.w3.org/TR/CSS1#font-weight CSS 1 ] | ||
*[http://www.w3.org/TR/CSS21/fonts.html#font-boldness CSS 2.1] | *[http://www.w3.org/TR/CSS21/fonts.html#font-boldness CSS 2.1] | ||
− | *[http://www.w3.org/TR/css3-fonts/#font- | + | *[http://www.w3.org/TR/css3-fonts/#font-styling CSS 3] |
== Browser Compatibility == | == Browser Compatibility == | ||
== See Also == | == See Also == |
Latest revision as of 17:44, 14 December 2006
This document is a work in progress and is subject to change.
Contents
Summary
The font-weight property is used to control the weight or boldness of a font for a defined section. The weight can be declared absolutely or relatively to the parent or user's default font size.
Applicability: | The font-weight property can be used for all CSS elements. | |
Media Group: | Visual | |
Inherited: | Yes |
Syntax
TARGET_ELEMENT { font-weight: normal } TARGET_ELEMENT { font-weight: 700 } TARGET_ELEMENT { font-weight: bolder }
Legal Values
Values can be entered in 3 ways:
Method | Range | Example |
---|---|---|
Numeric Value | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | '400' represents normal weight, '700' represents bold weight |
Relative Weight | lighter | bolder | (Relative to parent or user font table) |
Boolean Weight | normal | bold | Sets weight to either normal or bold |
See usage examples section for more details.
Mozilla Recommended Values
Usage Examples
p{font-weight: bold} /*Set paragraph text to be bold.*/
h1{font-weight: 500} /*Set h1 (level 1 heading) text to one step darker than normal but less than a standard bold.*/
span{font-weight: lighter} /*Sets text enclosed within span tag to be one step lighter than the parent or user font table*/
Notes
The World Wide Web Consortium (W3C) provides a free online CSS validation service.