DEV Community

Discussion on: %, px, em, rem, viewport...How to know which one to use in CSS for responsive design?

Collapse
 
emptyother profile image
emptyother

I have had good experience with using mostly EM for heights and % for widths so far. And REM to reset the font size when I'm doing component-like development. Viewport sizes (vh,vw) only on root elements. Not on floating components.

Collapse
 
jharteaga profile image
Jose Arteaga

Thanks for your answer! Definitely I need to retake this topic and understand deeper some units. I think I'm mixing all of them without reason.