FrontendDeveloper.in

CSS question detail

What is the difference between `em`, `rem`, `%`, `vw`, and `vh` units?

  • em: relative to parent font-size.
  • rem: relative to root font-size.
  • %: relative to parent dimension/property context.
  • vw/vh: relative to viewport width/height.

Choosing units intentionally improves responsive behavior and accessibility.

Back to all CSS questions
Get LinkedIn Premium at Rs 399