Font Weight
The font-weight property is used to control how thick or bold text appears.
You can use values such as normal, bold, or numeric values such as 400 and 700.
How Font Weight Works
Example 1: Normal Weight
The normal value displays text with normal thickness.
CSS Code
p {
font-weight: normal;
}
Output
Welcome to CIIT Training Institute
Example 2: Bold Weight
The bold value makes text thicker and more prominent.
CSS Code
p {
font-weight: bold;
}
Output
Learn CSS at CIIT Training Institute
Example 3: Numeric Weight
Numeric values can be used to specify the exact font weight.
CSS Code
h2 {
font-weight: 700;
}
Output
CIIT Training Institute
Example 4: Different Font Weights
Different elements can use different numeric font weights.
CSS Code
.light {
font-weight: 300;
}
.normal {
font-weight: 400;
}
.medium {
font-weight: 500;
}
.bold {
font-weight: 700;
}
Output
300 - Light Text
400 - Normal Text
500 - Medium Text
700 - Bold Text
Common Font Weight Values
| Value | Description |
|---|---|
300
|
Light text |
400
|
Normal text |
500
|
Medium text |
600
|
Semi-bold text |
700
|
Bold text |
900
|
Extra bold text |
Simple Explanation
font-weight: normal; → Displays normal text thickness.
font-weight: bold; → Makes text bold.
font-weight: 400; → Represents normal font weight.
font-weight: 700; → Represents bold font weight.
Summary
The font-weight property controls
the thickness of text. Common values include
normal, bold, and
numeric values such as 400 and
700.