引导程序-每行都应将容器作为直接父容器吗? [英] Bootstrap - should each row have container as immediate parent?

查看:31
本文介绍了引导程序-每行都应将容器作为直接父容器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道column应该以row作为直接父代(或更确切地说,rows应该仅以columns作为其直接直系子代),但是row是否必须以container/container-fluid作为直接父代?

I know column should have row as immediate parent (or, to be precise, rows should have only columns as ther immediate children) but does row must have container/container-fluid as immediate parent?

我在文档中找不到提及它的地方,而且我看到了两个例子:rows有和没有各自的containers.

I couldn't find mentioning it in docs and i've seen examples of both: where rows do and don't have their respective containers.

推荐答案

这取决于Bootstrap版本以及所需的内容对齐方式,但是通常需要容器...

It depends on the Bootstrap version, and how you want the content aligned, but generally containers are required...

版本3.x

行必须放在.container(固定宽度)或 .container-fluid(全宽),以正确对齐和填充."

"Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding."

版本4.x

容器是Bootstrap中最基本的布局元素, 使用我们的默认网格系统时需要."

"Containers are the most basic layout element in Bootstrap and are required when using our default grid system."

网格系统的顶层元素是.row,因此行的应该是容器的立即子级. Bootstrap 4的灵活性更高行和行可以不创建沟槽创建列,并且间距utils可以是用于调整填充和边距.

The top level element of the grid system is the .row, and therefore row's should be the immediate child of a container. Bootstrap 4 is more flexible in that rows & columns can be created without gutters, and the spacing utils can be used to adjust padding and margins.

这篇关于引导程序-每行都应将容器作为直接父容器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆