Replies: 1 comment 1 reply
-
Hey! 👋 The Whatever you wrap it around is up to you and the needs of your project. Typically, the page content comes within it, while the header/footer span across the full width - but it's also possible to have the entire website markup wrapped within a container 👍 There is nothing wrong with using The Responsive max widthsFrom the
This is useful to incrementally widen the max-width container based on the current breakpoint you're in, instead of having to do it manually. Config OptionsAlmost every time you add a max-width container, you'll also want to add some horizontal padding to avoid the content to touch the left and right edges of the viewport. The // tailwind.config.js
module.exports = {
theme: {
container: {
padding: {
DEFAULT: '1rem',
sm: '2rem',
lg: '4rem',
xl: '5rem',
'2xl': '6rem',
},
},
},
}; Same goes with centering the container (instead of pairing with the // tailwind.config.js
module.exports = {
theme: {
container: {
center: true,
},
},
} If you like the idea of being able to set some default padding and have your containers respect that everywhere you use the Hope it helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there, what's the intended use-case for the container class?
Is it to wrap the whole website (ie; top app bar, menus, classic boxed website) or is to wrap the page content (top app bar, menu sit outside)?
I'm looking to wrap the page content, so I'm just trying to work if Max Width class is more appropriate.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions