Mystery overflowing element

To piggy-back on what @dram mentioned, this is because vw’s don’t take into account the scroll bar width. If you know for a fact your site won’t scroll down (let’s say you have a small centered div with a form or something - no other elements) then 100vw will work.

Since that’s not always the case, it’s a good habit to use 100% for full-width elements (and 100vh for full-height elements) across the board.

2 Likes