0% completed
Relative units allow you to design layouts that adapt to different environments. Unlike absolute units, these units depend on another value in your design. They help create scalable, flexible layouts and typography.
Explanation:
html
element sets the base font size to 16px, so 1rem equals 16px.h1
uses 2rem, making it 32px, and its margin-bottom of 0.5em is calculated relative to its font size (0.5 × 32px = 16px).These units make it easy to create designs that adjust automatically to the size of the screen.
Explanation:
.full-screen-section
uses 100vw
and 100vh
to always cover the full width and height of the viewport, regardless of device size.Relative units like em, rem, vw, and vh are essential for creating responsive and adaptive designs.
Using these units helps build flexible designs that can adapt to various devices and user settings, ensuring a consistent experience across platforms.
.....
.....
.....