0
0
CSSmarkup~20 mins

Font size in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Font Size Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the computed font size of the paragraph?
Given the CSS below, what will be the font size of the paragraph text in the browser?
CSS
html {
  font-size: 16px;
}
body {
  font-size: 1.25rem;
}
p {
  font-size: 120%;
}
A24px
B19.2px
C16px
D20px
Attempts:
2 left
💡 Hint
Remember that 1rem equals the font size of the root element (html).
rendering
intermediate
2:00remaining
Which CSS rule will make the heading twice as large as the base font size?
Assuming the base font size is 16px, which CSS rule will render the heading text at 32px?
Ah1 { font-size: 2rem; }
Bh1 { font-size: 200%; }
Ch1 { font-size: 32px; }
DAll of the above
Attempts:
2 left
💡 Hint
Think about how rem, percentage, and px units relate to the base font size.
selector
advanced
2:00remaining
Which CSS selector targets only paragraphs with font size exactly 1.5rem?
Given multiple paragraphs with different font sizes, which selector matches only those with font size 1.5rem?
Ap[style$='font-size: 1.5rem']
Bp[style^='font-size: 1.5rem']
Cp[style*='font-size: 1.5rem']
Dp[style='font-size: 1.5rem']
Attempts:
2 left
💡 Hint
The *= attribute selector matches if the value contains the substring anywhere.
layout
advanced
2:00remaining
How does changing font size affect Flexbox layout?
In a flex container with items sized by font size (using em units), what happens if the container's font size increases?
AFlex items grow larger because em units scale with the container's font size.
BFlex items stay the same size because em units are fixed to the root font size.
CFlex items shrink because font size increase reduces available space.
DFlex items disappear because em units become invalid.
Attempts:
2 left
💡 Hint
Remember that em units depend on the font size of the element itself or its parent.
accessibility
expert
2:00remaining
Which font size practice best supports accessibility for users with low vision?
Choose the CSS font size approach that best supports accessibility and user control.
AUse fixed pixel font sizes like 14px for all text.
BUse relative font sizes like rem or em and allow user scaling.
CUse very small font sizes to fit more content on screen.
DUse absolute font sizes with !important to prevent changes.
Attempts:
2 left
💡 Hint
Think about how users can adjust text size in their browsers or devices.