font-weight

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Short information
CSS CSS1
Default value normal
Inherited Yes
Applied To all elements
HTML analog <B>
Reference to specification http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight

Description
It determines a font saturation. Value is established from 100 to 900 with step 100. The superlight protraction which can display a browser, matters 100 and superfat does 900. The normal type face (which it is installed by default) is equivalent to 400, the standard semiboldface text — to value 700.

Syntax
font-weight: bold | bolder | lighter | normal | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900.

Values
The font saturation is set with the help of keywords: bold — semiboldface, bolder — fat; lighter — light, normal — a normal type face. Also you can use standard units from 100 to 900.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <title>font-weight</title>
  <style type="text/css">
   H1 {
    font-weight: normal; /* Normal font weight */
   } 
   .select {
    color: maroon; /* Text color */
    font-weight: 600; /* Bold font weight */
   }
  </style>
 </head>
 <body>
 
  <h1>Duis te feugifacilisi</h1>
  <p><span class="select">Lorem ipsum dolor sit amet</span>, 
  consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet 
  dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud 
  exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
  consequat.</p>
 
 </body>
</html>

The result of this example is shown on the figure 1


Object model

[window.]document.getElementById("elementID").style.fontWeight

Remark
Browser is not always able to show the necessary font weight in the right way; it depends on text size and font type.