Font weight – How to use html font weight with examples

Font weight

Font weight property is used to set the “weight” of specified text in HTML document. A value can be set straightaway to bold or a value can be set between thin to thicker, we will show you how!

You can also use simple <b> tag to make text bold however using CSS is recommend.

Two example are shown below for how to use font-weight property of CSS in HTML document. One with simple values: bold, lighter and normal – normal is default value.

Second example uses numeric value to set “weight” of specified text.

Font-weight example to make text bold, lighter and normal

This example sets the font-weight of heading1 as bold, heading 2 to use lighter and makes it normal for paragraph.

Font weight example with numeric value

A number can also be given in font-weight property to specify from normal to bold range. A value of 400 means its normal and 700 means bold. You can use between or less and higher to make text look more thinner or thicker. The example below demonstrates using numeric value for headings and paragraph.

Also see HTML table | CSS font | HTML form | HTML Font

Was this article helpful?

Related Articles

Leave A Comment?