The basics of bold text
When it comes to styling text on the web, bold type is a powerful tool for emphasising important information and creating a clear visual hierarchy. Whether you're designing a website, writing a blog post or coding an email template, knowing how to apply bold text with CSS and HTML helps your content stand out.
Bold text makes characters look thicker and darker than the text around them. It's commonly used for headings, key points and warnings. In this article we'll look at the different ways to create it, and when to use each one.
Bold text in HTML: <strong> and <b>
HTML has two tags that make text bold by default. They look the same, but they mean different things.
The <strong> tag
<strong> marks text that is important, serious or urgent: a warning, a key instruction, or the one sentence readers mustn't miss.
Warning: <strong>do not unplug the device</strong> during the update.
The <b> tag
<b> draws attention to text without suggesting it's more important, such as keywords in a summary, product names, or ingredients in a recipe.
Add the <b>flour</b>, <b>sugar</b> and <b>butter</b> to a large bowl.
Warning: do not unplug the device during the update.
Add the flour, sugar and butter to a large bowl.
| Use | When the text is... |
|---|---|
<strong> | Genuinely important or urgent |
<b> | Just meant to stand out visually, such as keywords or names |
CSS font-weight | Bold for design reasons only, such as headings, buttons or labels |
Good to know: the original version of this post said <strong> mainly conveys importance to screen readers. In fact, most screen readers (software that reads pages aloud) don't announce bold or strong text at all by default. Choose <strong> because it describes your content accurately, and make sure important messages are also clear from the words themselves.
The CSS font-weight property
For full control over how bold text looks, use the CSS font-weight property. It's the most straightforward way to make any element bold:
.bold-text {
font-weight: bold; /* or font-weight: 700; */
}
<p class="bold-text">This text is bold using CSS.</p>
Keywords and numbers
font-weight accepts keywords or numbers. Numbers give you finer control, from thin to extra heavy:
| Number | Common name | Keyword |
|---|---|---|
100 | Thin | |
200 | Extra light | |
300 | Light | |
400 | Normal (regular) | normal |
500 | Medium | |
600 | Semi bold | |
700 | Bold | bold |
800 | Extra bold | |
900 | Black (heavy) |
Here's each weight, shown in your device's system font:
100: Thin
200: Extra light
300: Light
400: Normal
500: Medium
600: Semi bold
700: Bold
800: Extra bold
900: Black
You'll only see a difference between weights the font actually includes. Many fonts only come in regular (400) and bold (700); if you ask for 600, the browser uses the closest weight available. On some devices, several of the lines above may look the same for this reason.
Tip: headings (<h1> to <h6>) are bold by default. To make a heading lighter, set font-weight: 400 or 600 on it.
Relative weights: bolder and lighter
The keywords bolder and lighter set a weight relative to the parent element's weight, rather than a fixed value:
.emphasis { font-weight: bolder; }
.subtle { font-weight: lighter; }
bolder steps up to the next heavier "standard" weight: 400 becomes 700, and 700 becomes 900. lighter steps down: 700 becomes 400. This is how browsers make <strong> text bold by default, so it still stands out inside text that's already bold.
Three ways to add the CSS
You can apply font-weight in any of the usual ways that CSS can be added to a page.
1. In an external stylesheet
The best choice for most websites: all your styles live in one .css file that every page shares.
<link rel="stylesheet" href="/css/styles.css">
2. In a <style> element
You can also write styles in a <style> element in the <head> of a page, handy for styles that only apply to one page:
<head>
<style>
.bold-text {
font-weight: bold;
}
</style>
</head>
<p class="bold-text">This text is bold using CSS.</p>
3. Inline styles
For a quick, one-off change, add a style attribute directly to the element:
<p style="font-weight: bold;">This text is bold using inline CSS.</p>
Inline styles are hard to reuse and update, so keep them for quick tests, and for HTML emails, where many email programs ignore styles written anywhere else.
Variable fonts and "fake" bold
Variable fonts
A variable font packs a whole range of weights into a single file. With one, you aren't limited to steps of 100: any number from 1 to 1000 can work, as long as the font supports it.
.subheading {
font-weight: 650; /* between semi bold and bold */
}
Many system fonts and Google Fonts are available as variable fonts, which makes fine-tuning your typography easy.
Fake ("faux") bold
If you ask for a bold weight but the font doesn't include one, the browser creates a fake bold by thickening the regular letters. This faux bold often looks smudged and uneven, especially in fonts with fine details.
The best fix is to load a real bold file for your web font. If you'd rather the browser never fakes it, you can turn synthetic bold off:
body {
font-synthesis-weight: none; /* never create fake bold */
}
Tip: when using web fonts, load only the weights you actually use. Each extra weight is another file to download, so regular and bold are often all you need.
Using bold text well
Bold text is a useful tool, but using it too much weakens its effect: if everything is bold, nothing stands out.
- Be selective. Bold a few key words or phrases, not whole paragraphs.
- Build a hierarchy. Combine weight with size, colour and spacing so headings, subheadings and body text are clearly different.
- Use italics for gentle emphasis.
<em>(italic) suits a change in tone, while bold suits importance. - Mind readability. Very heavy weights (800 to 900) work for short headings, but long passages are easier to read at normal weight.
- Don't rely on bold alone. Visual emphasis isn't announced by most screen readers, so make sure important messages are clear from the wording too.
Wrapping up
Use <strong> for important text and <b> for text that should simply stand out. For visual styling, reach for CSS font-weight, with numbers from 100 to 900, or any value in between with a variable font. Load real bold font files, use bold sparingly, and your text will be both striking and easy to read.