0
0
CSSmarkup~5 mins

Viewport units in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are viewport units in CSS?
Viewport units are CSS units that represent a percentage of the browser's visible area. They help make designs responsive by sizing elements relative to the screen size.
Click to reveal answer
beginner
What does 1vw represent?
1vw means 1% of the viewport's width. For example, if the browser width is 1000px, 1vw equals 10px.
Click to reveal answer
beginner
Name the four main viewport units in CSS.
  • vw: 1% of viewport width
  • vh: 1% of viewport height
  • vmin: 1% of smaller viewport dimension (width or height)
  • vmax: 1% of larger viewport dimension (width or height)
Click to reveal answer
beginner
Why use viewport units instead of fixed pixels?
Viewport units let elements resize automatically with the browser window. This makes your page look good on phones, tablets, and desktops without extra code.
Click to reveal answer
intermediate
How does vmin behave when viewport width is 800px and height is 600px?
vmin uses the smaller viewport dimension. Here, height is smaller (600px), so 1vmin equals 6px (1% of 600px).
Click to reveal answer
Which viewport unit represents 1% of the viewport height?
Avh
Bvw
Cvmin
Dvmax
If the viewport width is 1200px, what is the pixel value of 5vw?
A5px
B12px
C60px
D240px
Which viewport unit uses the larger dimension of width or height?
Avw
Bvmax
Cvmin
Dvh
Why are viewport units useful in responsive design?
AThey fix element sizes in pixels
BThey only work on desktop browsers
CThey replace media queries completely
DThey allow elements to scale with screen size
What does 10vmin mean if viewport width is 900px and height is 700px?
A70px
B90px
C100px
D10px
Explain what viewport units are and list their four types.
Think about how viewport units relate to screen size percentages.
You got /5 concepts.
    Describe a situation where using viewport units improves a website's design.
    Imagine viewing a website on a phone versus a desktop.
    You got /3 concepts.