How to center a container

Hey all,

what would be the best / easiest way to center a container when I reduced its width?

Depending on what you mean. Vertically or horizontally? Have you investigated Max-Width? If that doesn’t cover it then we need more details.

Yeah, I mean horizontally. When I set the container to have a width of let’s say 50vw then the container gets shifted to the left side of the screen, filling it with content to the middle of the page. I miss a simple option to have the container then centered in the browser window.

And yes, I have used the max-width tool to do that before (only touching the width settings here then and not in the container tool). Was just wondering if there was an easier way than using another stack for it. If there isn’t, I’ll get accustomed to the max-width tool eventually.

Max-Width does what Container used to. Most likely what you want.

2 Likes