Languages

CSS - what is difference between height: 100% and height: 100vh?

3 points
Asked by:
Giles-Whittaker
739

What is the difference between height: 100% and height: 100vh in CSS?

1 answer
3 points
Answered by:
Admin Dirask Community
4380

The vh values stand for viewport height.

Here is the main difference:

  • height: 100vh means 100% of the viewport height,
  • height: 100% means 100% of the parent's element height.

Warning:

When you use % for vertical margin or padding, percentage values will be calculated on the width of the parent element, not the height.

 

See also

  1. CSS - 100vh 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