How to Make Text Bold with font-weight in CSS
font-weight sets how heavy the text is. bold makes it bold, normal takes the bold away, and numbers such as 700 give the same weights in numbers.
Syntax
<selector> {
font-weight: <weight>;
}
| Part | What it does |
|---|---|
<selector> | The text to change. |
<weight> | bold or normal, a number from 1 to 1000 such as 700, or bolder and lighter, which go one step from the parent's weight. |
MDN's font-weight page says normal is the same as 400 and bold the same as 700.
The Example
The example is a short receipt: two items and a total. One rule makes the total bold.
Step 1: Write the Code
Create a file named index.html in a text editor, such as Visual Studio Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Font weight</title>
<style>
.total {
font-weight: bold;
}
</style>
</head>
<body>
<p>Coffee: 3.50</p>
<p>Cake: 4.00</p>
<p class="total">Total: 7.50</p>
</body>
</html>
Step 2: Open It in a Browser
Double-click index.html. It opens in your browser:

The screenshot comes from Chromium 159, the open-source browser that Chrome is built on.
What Happened
- The total is bold. Chromium gave it a font weight of 700.
- The two items stayed at 400, the normal weight.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
A made-up value, such as heavy | The value is invalid and ignored: the text stayed at 400 | Use bold, or a number such as 700 |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The text doesn't get bolder | The value is misspelled or made up | Use bold or a number |
| A heading is bold although you didn't ask for it | Browsers make headings bold by default | Set font-weight: normal on it |
FAQ
Is 700 the same as bold?
Yes. font-weight: 700 gave the same weight as bold: 700.
How do I remove the bold from a heading?
Set font-weight: normal. An h1 with it measured 400, the normal weight.
What does bolder do?
It goes one step heavier than the parent. In a page whose text was 400, bolder gave 700.
Conclusion
Use font-weight: bold or 700 to make text bold, and normal to remove the bold. Any other word is ignored, so stick to the keywords and the numbers.
Additional Resources
- font-weight, on MDN.
