I am finally becoming more familiar with bootstraps grid system but i'm still confused on a few things.
I know from their documentation they say containers are NOT nestable:
Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to padding and more, neither container is nestable.
But what does that really mean? they appear to be nest-able to me, except that each time you nest a container there will be the extra 15px margin padding on the left and right. (just as i would expect).
When they say nestable, do they mean directly parent/child nestable?
fiddle: https://jsfiddle.net/wt69swkg/1/
I have created a fiddle of a layout I made. The layout uses a container to create the initial body structure. Then I have a div with a class renderbody to set background color, etc. Finally I have a div with class renderbody-inner with a width of 95% and margin:auto to create a centered body area with gutters of 2.5% left and right.
This leaves me with the question of should I be using a container/container-fluid inside renderbody-inner so that I can use col-*s? Is the outer most container now useless because I filled it with divs that have %-based width?
^ this example is technically nesting containers but they are not direct parent/children. This is what is confusing me. I realize, at the end of the day I can do what I want. But I'm trying my best to follow the documentation / best practice.
<div class="container">
<div id="renderbody">
<div id="renderbody-inner">
<div class="container-fluid">
<!--Rendering body content here-->
<div style="height:200px; background-color:darkgrey">
</div>
</div>
</div>
</div>
</div>
EDIT: This is not a duplicate to: Multiple and/or nested Bootstrap containers?
The answers to that question answer it by providing the exact quotes I provide in my question. They do not answer my question of Why? or provide an explanation. (Which is what I am asking)
Aucun commentaire:
Enregistrer un commentaire