
Shobha
The best way to predict the future is to invent it
What are the differences between relative units like %, vw, and vh?
In CSS, %, vw, and vh define sizes relative to different references. The % unit calculates size as a proportion of the parent element's dimensions. The vw unit measures 1% of the viewport's width, while vh measures 1% of the viewport's height. These units help in designing layouts that adjust fluidly to the screen's dimensions, ensuring responsiveness.