Interview Question

What is rem unit?

rem uses the root element’s font size.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

The rem unit is relative to the root element’s font size. • One rem equals the computed font-size of the root element. • It is useful for consistent sizing that does not compound through nesting. • User font settings can affect rem-based sizes.

💡 Simple Example

.page-title { font-size: 2rem; }

⚡ Quick Revision

rem uses the root element’s font size.