Explain it in 60 seconds
CSS units: px, em, rem, percentages and viewport units
Frontend Engineering · HTML and CSS · Beginner
What are the common CSS units, and when should you use each?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- px: fixed.
- em: relative to element's font size (compounds).
- rem: relative to root font size.
- %: relative to parent.
- vw/vh: viewport; dvh for mobile.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.