Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS font-weight property

CSS font-weight property

Example

Three paragraphs with different font weights:

p

.normal

{

font-weight:

normal

;

}

p

.thick

{

font-weight:

bold

;

}

p

.thicker

{

font-weight:

900

;

}

Try it »


Property definition and usage

The font-weight property sets the weight of text

Default value: normal
Inherited: yes
Version: CSS1
JavaScript syntax: object.style.fontWeight="900"

Browser support

The numbers in the table indicate the first browser version that supports this property.

property
font-weight 2.0 4.0 1.0 1.3 3.5

Attribute values

Value Description
normal Default value. Defines standard characters.
bold Defines bold characters.
bolder Defines bolder characters.
lighter Defines lighter characters.
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
  • | Defines characters from thin to thick. 400 is equivalent to normal, and 700 is equivalent to bold. | | inherit | Specifies that the font weight should be inherited from the parent element. |

    Related Articles

    CSS Tutorial: CSS Font

    CSS Reference Manual: font property