Languages

CSS - what is difference between 100vw and 100%?

2 points
Asked by:
Kadeem-Craig
516

I was analysing some source code and, I have noticed there was used 100vw with width CSS property.

My question is:

Is 100vw the same like 100%?

If not, what is difference between 100vw and 100%?

1 answer
4 points
Answered by:
Root-ssh
178260

100vw means 100% width of viewport width.

e.g.

 

100% means 100% size of parent element size

It means:

  • width when width: 100% style property is used,
  • height when height: 100% style property is used.

e.g.

 

Viewport is a rectangular area that contains the part of the web page that is currently visible in web browser window.

 

See also

  1. CSS - 100vw meaning

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join