Understanding Containers with VW (View Width)

I just spent hours troubleshooting why my content was pushing horizontally off the screen. I made the body container 100vh and 100vw. Then I created a div inside this container and set it at 100vw assuming it would match the body container.

My entire document was shifted to the right side and was going off the page. How exactly are you supposed to use the 100% height/width or 100vw/100vh? Every time I use them it shifts the entire document to the right!

We’d need to see your HTML/CSS before we can help you with your specific issues. Usually you don’t need to set a width of 100% on the body since it will automatically be as wide as the browser window. By default, block elements take up the full width available. But again, I can’t comment specifically on your issue until I can see your code.

1 Like

I deleted all of the wd’s out of my document! In my mind I was thinking that I had to set 100vw in containers so that they would view correctly on different screen sizes. I think I was entirely incorrect about this entire thing.