Explain the importance of using relative units over absolute units in responsive design.
Instruction: Describe the differences between relative and absolute units, and why relative units are preferred in responsive design.
Context: This question assesses the candidate's understanding of CSS units and the significance of choosing relative units (e.g., em, rem, vw, vh) to create adaptable, responsive layouts.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Relative units, such as em, rem, vw (viewport width), and vh (viewport height), are dynamic. They adjust according to the parent element's font size, the root element's font size, or the dimensions of the viewport, respectively...