B.44. font-weight

This property sets the boldness of the font to be displayed in the element.

Inherited: Yes, but in the case of relative settings, the computed value is inherited.

See also: Section B.37font

B.44.1. Value

The CSS specification defines the following absolute values:

  • normal (equivalent to 400)

  • bold (equivalent to 700)

  • 100

  • 200

  • 300

  • 400

  • 500

  • 600

  • 700

  • 800

  • 900

Also available are the following relative values:

  • bolder

  • lighter

According to the CSS2 specification, bolder and lighter should select the next version that is bolder or lighter than the font inherited from the parent element, respectively.

Initial value: normal

B.44.2. Compatibility

CSS Version: 1

Supported by all CSS-compatible browsers.

Most browsers only really support normal and bold, mapping the numerical and relative values to those two absolute settings.

B.44.3. Example

This style rule overrides the default style sheets of most browsers that specify that strong elements should be rendered bold. On browsers that support more than one level of boldness, such elements will be displayed bolder than text in the parent element. Thus, a strong element inside a heading that is rendered bold will be rendered with even greater boldness.

strong {
  font-weight: bolder;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.2.184