【发布时间】:2021-02-04 13:36:43
【问题描述】:
昨天我正在审查我们的 HTML 结构,发现我们有容器用作这样的 row child
<section class="row graySeccion">
<div class="container py-5 graySeccion">
<div class="row mb-5">
<div class="col py-2 text-center">
<h1>WELCOME TO STEAM SCHOOLS</h1>
</div>
</div>
但是看着oficial documentation我可以看到这个注释。
In a grid layout, content must be placed within columns and only columns may be immediate children of rows.
我们有这个 row->container->row 有多大的错误,我们可能会破坏哪些东西?
我们应该开始重构我们的 HTML 结构吗?
【问题讨论】:
-
如果它看起来像你想要的那样,你不需要做任何事情。 Bootstrap 的行和列(至少在历史上)使用了负边距技巧,如果嵌套不正确,这可能看起来很不稳定。
标签: html bootstrap-4 bootstrap-grid