0
0
CSSmarkup~5 mins

Relative units in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are relative units in CSS?
Relative units are measurements that depend on another value, like the size of the parent element or the root font size. They help make designs flexible and responsive.
Click to reveal answer
beginner
What does em unit represent in CSS?
em is a relative unit that equals the font size of the current element. For example, if the font size is 16px, 1em equals 16px.
Click to reveal answer
intermediate
How is rem different from em?
rem stands for 'root em' and is always relative to the root element's font size (usually the <html> font size), not the current element's font size.
Click to reveal answer
beginner
What does the % unit mean in CSS?
The % unit is relative to the size of the parent element. For example, width: 50% means half the width of the parent container.
Click to reveal answer
beginner
Why use relative units instead of fixed units like px?
Relative units make your website adapt to different screen sizes and user settings, improving accessibility and responsiveness.
Click to reveal answer
Which CSS unit is always relative to the root element's font size?
Aem
Brem
Cpx
D%
If a parent element has a width of 400px, what is the width of a child element with width: 50%?
A200px
B50px
C400px
D100px
What does 1em equal if the current element's font size is 20px?
A20px
BDepends on the root font size
C24px
D16px
Which unit is NOT a relative unit in CSS?
Arem
Bem
C%
Dpx
Why are relative units important for accessibility?
AThey prevent resizing
BThey make text size fixed
CThey allow text to scale with user settings
DThey only work on desktop
Explain the difference between em and rem units in CSS.
Think about which element's font size each unit depends on.
You got /3 concepts.
    Describe why using relative units helps make a website responsive and accessible.
    Consider how fixed sizes behave on small or large screens.
    You got /4 concepts.