Font weight controls how thick or thin the text looks. It helps make words stand out or look lighter.
Font weight in CSS
Start learning this pattern below
Jump into concepts and practice - no test required
font-weight: value;The value can be keywords like normal or bold, or numbers from 100 to 900 in steps of 100.
Higher numbers mean thicker text. Default is usually normal (400).
font-weight: normal;font-weight: bold;font-weight: 300;font-weight: 900;This page shows four paragraphs with different font weights: normal, bold, light, and heavy. You can see how the thickness of the text changes.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Font Weight Example</title> <style> body { font-family: Arial, sans-serif; padding: 1rem; line-height: 1.5; } .normal { font-weight: normal; } .bold { font-weight: bold; } .light { font-weight: 300; } .heavy { font-weight: 900; } </style> </head> <body> <p class="normal">This text is normal weight (400).</p> <p class="bold">This text is bold weight (700).</p> <p class="light">This text is light weight (300).</p> <p class="heavy">This text is heavy weight (900).</p> </body> </html>
Not all fonts support every numeric weight. If a weight is not supported, the browser picks the closest available.
Using keywords like normal and bold is simpler and more compatible.
Font weight affects readability and style, so choose weights that fit your design and audience.
Font weight changes how thick or thin text looks.
You can use keywords like normal and bold, or numbers from 100 to 900.
Different weights help highlight or soften text in your design.
Practice
font-weight control in text?Solution
Step 1: Understand the role of
Thefont-weightfont-weightproperty changes the thickness of the text, making it look bolder or lighter.Step 2: Compare with other text properties
Color changes text color, size changes text size, and font family changes the font style, not thickness.Final Answer:
How thick or thin the text appears -> Option AQuick Check:
font-weight controls thickness [OK]
- Confusing font-weight with font-size
- Thinking font-weight changes color
- Mixing font-weight with font-family
font-weight?Solution
Step 1: Recall valid
Valid values include keywords likefont-weightvaluesnormal,bold, or numbers 100 to 900 in steps of 100.Step 2: Check each option
font-weight: bold; usesboldwhich is correct. font-weight: 1000; uses 1000 which is invalid. Options A and D use invalid keywords.Final Answer:
font-weight: bold; -> Option AQuick Check:
Use 'bold' keyword for bold text [OK]
- Using numbers outside 100-900 range
- Using invalid keywords like 'heavy' or 'strong'
- Missing semicolon at end
p.normal { font-weight: 400; }
p.bold { font-weight: 700; }Solution
Step 1: Understand numeric font-weight values
400 is the normal weight, and 700 is the bold weight, so 700 is thicker text.Step 2: Compare the two classes visually
Text with class 'normal' will appear thinner than text with class 'bold'. Italic style is unrelated to font-weight.Final Answer:
Text with class 'normal' is thinner than text with class 'bold' -> Option DQuick Check:
400 < 700 means thinner < bolder [OK]
- Thinking 400 is bolder than 700
- Confusing font-weight with font-style
- Assuming no difference between 400 and 700
h1 { font-weight: 950; }Solution
Step 1: Check valid font-weight numeric values
Valid numeric values are multiples of 100 from 100 to 900 only.Step 2: Validate the given value
950 is outside the valid range, so it is invalid and will be ignored by browsers.Final Answer:
950 is not a valid font-weight value -> Option BQuick Check:
font-weight numbers must be 100-900 [OK]
- Using numbers outside 100-900
- Adding units like px or em to font-weight
- Confusing font-weight with font-style
font-weight value is best to use?Solution
Step 1: Understand font-weight scale
Lower numbers like 300 are light, 400 is normal, 700 is bold, and 900 is very bold.Step 2: Choose a weight thicker than normal but less than bold
600 is between normal (400) and bold (700), so it makes text thicker but not fully bold.Final Answer:
font-weight: 600; -> Option CQuick Check:
600 is semi-bold, perfect for emphasis [OK]
- Using 300 which is lighter than normal
- Using 900 which is too bold
- Using 'normal' which is not thicker
