1. Home
  2. Computer Science MCQs
  3. Cascading Style Sheets - CSS
  4. Which CSS unit is relative to viewport width?

Added 14 Sep 2025

Which CSS unit is relative to viewport width?

  1. vw Correct answer
  2. em
  3. rem
  4. %

Correct answer

A. vw

15 views

MCQSEXAM

Explanation

vw (viewport width) is relative to the width of the browser viewport: 1vw equals 1% of it, so 50vw is always half the screen width. Its partner vh does the same for height.

em is relative to the element's font size, rem to the root font size, and % to the parent element. Viewport units are central to responsive design.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Reference

https://developer.mozilla.org/en-US/docs/Web/CSS/length

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Cascading Style Sheets - CSS MCQs

Practise all Cascading Style Sheets - CSS MCQs

Similar MCQs