Languages

CSS - why does width: 100vw causes horizontal overflow?

0 points
Asked by:
nickkk0
647

Why does width: 100vw causes horizontal overflow making my web page more than 100vw?

1 answer
0 points
Answered by:
Admin Dirask Community
4380

The horizontal scrollbar appears because the vertical scrollbar's width is being taken into account.

Set your main component width to 100vw, then use width: 100% for the rest of your components. You can also use max-width: 100vw for the main component.

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