Container Question

What’s the best practice regarding the container stack?

If I’m working on one page, would it be better to put all Foundry stacks in one container or put each stack in its own container?

I’m thinking the results would be the same, but I’m not sure what’s technically better.


It depends on the layout you’re going for. If everything on the page is going to have the same Container max-width, then just go with one Container stack. If you’re going to mix sections of content with different max-widths, or have some stacks you want to go edge-to-edge in the browser, you could mix and match multiple Containers. It all comes down to the page you’re building and what you’re trying to accomplish. This is why there is a Container stack instead of setting the max-width in the Control Center stack – more flexibility this way,

1 Like

Thanks @elixirgraphics,

That makes perfect sense.

Not a problem at all.

It sounds silly question though, do I need the container for a banner or the Navi bar?

The Banner and Navigation Bar both have built-in ways to limit the width of their internal content.

Containers are specifically for limiting the width of content within them. When thinking about whether you need a Container just think “Do I need to limit the width of everything inside this stack?” If yes, then a Container stack can be used. If a stack like a Banner or Navigation Bar already has such a feature built-in you do not need a Container.

1 Like

Thank you very much. Fully understood. Be Safe.

1 Like