Is it good practice to use multiple .container
and .container-fluid
s? (not nested)
I’d like to create some segments of my page with max-width
and some without any.
Is it good practice to use multiple .container
and .container-fluid
s? (not nested)
I’d like to create some segments of my page with max-width
and some without any.
3
Answers
You can use any number of ‘.containers’ and ‘.container-fluid”s in a page. Beware when you are using nested ‘.container’ since its having fixed widths at breakpoints. The examples in the bootstrap site itself have used multiple containers. So you can use..
This is well answered here: Multiple and/or nested Bootstrap containers?
Usually, with Bootstrap I use more than one container: one for the main content itself, the normal one; one inside the .header; and one inside the .footer.
You can use both, and also nested if required in your layout web page.
I’m currently using a
.container
for each section on my website. It’s based on this template: http://blackrockdigital.github.io/startbootstrap-stylish-portfolio/.As long as you don’t nest them you’ll be good!