Discover how a single CSS property can transform your text from plain to powerful instantly!
Why Font weight in CSS? - Purpose & Use Cases
Imagine you are designing a webpage and want some text to look bold to grab attention, while other text stays normal. You try to make text bold by manually changing the font style in an image editor or by using different font files for each weight.
This manual way is slow and tricky. You have to create or find separate font files for each thickness, and if you want to change the weight later, you must redo everything. It's hard to keep text consistent and update styles quickly.
CSS font weight lets you easily control how thick or thin your text looks by just changing one property. You can pick from normal, bold, or numeric weights like 400 or 700, and the browser handles the rest automatically.
font-family: 'MyBoldFont'; /* separate font file for bold */ font-family: 'MyRegularFont'; /* separate font file for normal */
font-weight: 700; /* bold text */ font-weight: 400; /* normal text */
You can quickly and consistently change text thickness across your whole site with simple CSS, making your design flexible and easy to update.
On a blog, you want headings to stand out with bold text and paragraphs to stay normal. Using font weight, you just add font-weight: bold; to headings and font-weight: normal; to paragraphs without extra font files.
Font weight controls text thickness using simple CSS.
It avoids the need for multiple font files for different weights.
It makes styling text faster, easier, and more consistent.