Changes

Jump to: navigation, search

CSS GUIDE FONT WEIGHT

2,238 bytes added, 18:41, 14 December 2006
no edit summary
<span style="margin:0;background:#ffff33;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;">This document is a work in progress and is subject to change.</span><br /><br />
== 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.
<table border="0">
<tr>
<td><b>Applicability:</b></td><td>The font-weight property can be used for all CSS elements.<td>
</tr>
<tr>
<td><b>[http://developer.mozilla.org/en/docs/CSS:%40media#Media_groups Media Group:]</b>
</td><td>Visual</td>
</tr>
<tr>
<td><b>Inherited:</b></td><td>Yes</td>
</tr>
</table>

== Syntax ==
<pre>
TARGET_ELEMENT { font-weight: normal }
TARGET_ELEMENT { font-weight: 700 }
TARGET_ELEMENT { font-weight: bolder }
</pre>

== Legal Values ==
Values can be entered in 3 ways:

<table border="2">
<tr>
<th>Method</th><th>Range</th><th>Example</th>
</tr>
<tr>
<td>Numeric Value</td><td>100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900</td><td>'400' represents normal weight, '700' represents bold weight</td>
</tr>
<tr>
<td>Relative Weight</td><td>lighter | bolder</td><td>(Relative to parent or user font table)</td>
</tr>
<tr>
<td>Boolean Weight</td><td>normal | bold</td><td>12pt.</td>
</tr>
</table>

See [[#Usage Examples | usage examples]] section for more details.

== Mozilla Recommended Values ==

== Usage Examples ==
<pre>p{font-weight: bold} /*Set paragraph text to be bold.*/</pre>
<pre>h1{font-weight: 500} /*Set h1 (level 1 heading) text to one step darker than normal but less than a standard bold.*/</pre>
<pre>span{font-weight: lighter} /*Sets text enclosed within span tag to be one step lighter than the parent or user font table*/</pre>

== Notes ==
The [http://www.w3.org World Wide Web Consortium (W3C)] provides a free online [http://jigsaw.w3.org/css-validator/ CSS validation service].

== Specification Conformance ==
*[http://www.w3.org/TR/CSS1#font-weight CSS 1 ]
*[http://www.w3.org/TR/CSS21/fonts.html#font-weight-props CSS 2.1]
*[http://www.w3.org/TR/css3-fonts/#font-weight-props CSS 3]

== Browser Compatibility ==

== See Also ==
1
edit

Navigation menu