Bird
Raised Fist0
CSSmarkup~20 mins

Font weight in CSS - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Font Weight Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding font-weight numeric values
Which CSS font-weight value will make the text appear bolder than normal but not as bold as the maximum weight?
Afont-weight: 900;
Bfont-weight: 400;
Cfont-weight: 100;
Dfont-weight: 600;
Attempts:
2 left
💡 Hint
Think about the numeric scale where 400 is normal and 900 is the boldest.
📝 Syntax
intermediate
2:00remaining
Correct font-weight syntax
Which CSS rule correctly sets the font weight to bold?
Afont-weight = bold;
Bfont-weight bold;
Cfont-weight: bold;
Dfont-weight: "bold";
Attempts:
2 left
💡 Hint
Remember the CSS property syntax uses a colon and no equals sign.
rendering
advanced
2:00remaining
Visual difference of font-weight values
Given this CSS, what will the text look like?
p { font-weight: 300; }
CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
p { font-weight: 300; }
</style>
<title>Font Weight Test</title>
</head>
<body>
<p>This text is light.</p>
</body>
</html>
AThe text appears very bold and thick.
BThe text appears lighter than normal, thinner strokes.
CThe text appears normal weight, neither bold nor light.
DThe text is invisible because font-weight 300 hides it.
Attempts:
2 left
💡 Hint
Lower numeric font-weight values produce lighter text.
selector
advanced
2:00remaining
Applying font-weight with class selectors
Which CSS rule will make all elements with class highlight have bold text?
A.highlight { font-weight: bold; }
B#highlight { font-weight: bold; }
Chighlight { font-weight: bold; }
D*highlight { font-weight: bold; }
Attempts:
2 left
💡 Hint
Class selectors start with a dot (.) in CSS.
accessibility
expert
3:00remaining
Accessibility impact of font-weight choices
Why is it important to avoid using very light font-weight (like 100 or 200) for body text in web design?
ABecause very light font-weight can reduce readability for users with low vision or on low contrast screens.
BBecause light font-weight causes the text to load slower in browsers.
CBecause light font-weight disables keyboard navigation on the page.
DBecause light font-weight makes the text unselectable by users.
Attempts:
2 left
💡 Hint
Think about how font thickness affects how easy it is to read text.

Practice

(1/5)
1. What does the CSS property font-weight control in text?
easy
A. How thick or thin the text appears
B. The color of the text
C. The size of the text
D. The font family used

Solution

  1. Step 1: Understand the role of font-weight

    The font-weight property changes the thickness of the text, making it look bolder or lighter.
  2. Step 2: Compare with other text properties

    Color changes text color, size changes text size, and font family changes the font style, not thickness.
  3. Final Answer:

    How thick or thin the text appears -> Option A
  4. Quick Check:

    font-weight controls thickness [OK]
Hint: Remember: weight means thickness of letters [OK]
Common Mistakes:
  • Confusing font-weight with font-size
  • Thinking font-weight changes color
  • Mixing font-weight with font-family
2. Which of the following is the correct CSS syntax to make text bold using font-weight?
easy
A. font-weight: bold;
B. font-weight: 1000;
C. font-weight: heavy;
D. font-weight: strong;

Solution

  1. Step 1: Recall valid font-weight values

    Valid values include keywords like normal, bold, or numbers 100 to 900 in steps of 100.
  2. Step 2: Check each option

    font-weight: bold; uses bold which is correct. font-weight: 1000; uses 1000 which is invalid. Options A and D use invalid keywords.
  3. Final Answer:

    font-weight: bold; -> Option A
  4. Quick Check:

    Use 'bold' keyword for bold text [OK]
Hint: Use 'bold' keyword or 700 for bold text [OK]
Common Mistakes:
  • Using numbers outside 100-900 range
  • Using invalid keywords like 'heavy' or 'strong'
  • Missing semicolon at end
3. What will be the visual difference between these two CSS rules?
p.normal { font-weight: 400; }
p.bold { font-weight: 700; }
medium
A. Text with class 'bold' is italicized
B. Both texts look exactly the same
C. Text with class 'normal' is bolder than 'bold'
D. Text with class 'normal' is thinner than text with class 'bold'

Solution

  1. Step 1: Understand numeric font-weight values

    400 is the normal weight, and 700 is the bold weight, so 700 is thicker text.
  2. 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.
  3. Final Answer:

    Text with class 'normal' is thinner than text with class 'bold' -> Option D
  4. Quick Check:

    400 < 700 means thinner < bolder [OK]
Hint: Higher number means thicker text [OK]
Common Mistakes:
  • Thinking 400 is bolder than 700
  • Confusing font-weight with font-style
  • Assuming no difference between 400 and 700
4. Identify the error in this CSS snippet:
h1 { font-weight: 950; }
medium
A. Missing units after 950
B. 950 is not a valid font-weight value
C. font-weight cannot be used on h1
D. Should use font-style instead of font-weight

Solution

  1. Step 1: Check valid font-weight numeric values

    Valid numeric values are multiples of 100 from 100 to 900 only.
  2. Step 2: Validate the given value

    950 is outside the valid range, so it is invalid and will be ignored by browsers.
  3. Final Answer:

    950 is not a valid font-weight value -> Option B
  4. Quick Check:

    font-weight numbers must be 100-900 [OK]
Hint: Use multiples of 100 between 100 and 900 [OK]
Common Mistakes:
  • Using numbers outside 100-900
  • Adding units like px or em to font-weight
  • Confusing font-weight with font-style
5. You want to highlight a warning message by making its text thicker but not fully bold. Which font-weight value is best to use?
hard
A. font-weight: 300;
B. font-weight: 900;
C. font-weight: 600;
D. font-weight: normal;

Solution

  1. Step 1: Understand font-weight scale

    Lower numbers like 300 are light, 400 is normal, 700 is bold, and 900 is very bold.
  2. 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.
  3. Final Answer:

    font-weight: 600; -> Option C
  4. Quick Check:

    600 is semi-bold, perfect for emphasis [OK]
Hint: Use 600 for semi-bold emphasis [OK]
Common Mistakes:
  • Using 300 which is lighter than normal
  • Using 900 which is too bold
  • Using 'normal' which is not thicker