Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS font-weight property


May 05, 2021 CSS Reference Manual


Table of contents


CSS font-weight property


Three paragraphs of text set different font weights:

p.normal {font-weight:normal;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}

Try it out . . .

Description of property definition and use

The font-weight property sets the weight of the text

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


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
font-weight 2.0 4.0 1.0 1.3 3.5

The property value

Value Describe
normal The default. Define standard characters.
bold Define bold characters.
bolder Define thicker characters.
lighter Define thinner characters.
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
Define characters from thick to thin. 400 is equal to normal, and 700 is equivalent to bold.
inherit Specifies that the weight of the font should be inherited from the parent element.


Related articles

CSS tutorial: CSS Font

CSS Reference Manual: Font Properties