How to change font weight of Div using CSS?

Answer

To change font weight of Div using CSS, you can set the font-weight style property for the div elements with the values like bold, thin, normal, etc.

CSS Code

The following is the typical CSS code to change font weight of Div in HTML page using tag name div.

Using bold font weight

div {
   font-weight: bold;
}

Using thin font weight

div {
   font-weight: thin;
}

Using normal font weight

div {
   font-weight: normal;
}

Examples

We shall go through some working examples on how to change font weight of Div using CSS. In the following examples, you may change the value of font-weight and Run the code to visually observe the changes made to the Div elements.

Example 1

This is an example on how to change font weight of Div using bold font weight.

You may edit the following code, and click on Run button.

Example 2

This is an example on how to change font weight of Div using thin font weight.

You may edit the following code, and click on Run button.

Example 3

This is an example on how to change font weight of Div using normal font weight.

You may edit the following code, and click on Run button.