1
我有时会发现自己希望为内容位于标准容器内的网站的一部分放置全宽背景。例如:为什么不应该引导容器嵌套?
<div class="container">
<!--here is a section of awesome things that doesn't need a full width background -->
</div>
<div class="container-fluid" style="background-color: purple">
<div class="container>
<p>This is an average paragraph</p>
</div>
</div>
Bootstrap says NOT to nest containers。
Note that, due to padding and more, neither container is nestable.
我知道我可以在一个类中创建一个不同的div,但我不知道嵌套容器的具体危险可能是什么?
可以使用倍数,但没有嵌套。而不考虑风险。风险在于bootstrap中的一些内容依赖于相对选择器。这些可能会在嵌套的情况下破裂。我之前已经遇到过嵌套各种元素。 – Derple