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?
✗ Incorrect
rem is relative to the root font size, while em is relative to the current element's font size.If a parent element has a width of 400px, what is the width of a child element with
width: 50%?✗ Incorrect
50% means half of the parent's width, so 50% of 400px is 200px.
What does
1em equal if the current element's font size is 20px?✗ Incorrect
em units are relative to the current element's font size, so 1em equals 20px here.Which unit is NOT a relative unit in CSS?
✗ Incorrect
px is a fixed unit, not relative to anything else.Why are relative units important for accessibility?
✗ Incorrect
Relative units let text and elements scale based on user preferences, helping people with different vision needs.
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.