Bootstrap Grid,我需要一个容器吗? [英] Bootstrap Grid, do I need a container?

查看:71
本文介绍了Bootstrap Grid,我需要一个容器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用bootstrap 3,我注意到如果您在没有容器的情况下使用Grid System,它会变得很流畅,有人告诉我我不应该这样做,因为该系统被设计为位于容器内.如果我不使用容器类会发生什么情况?需要吗?如果可以,那么可以使容器类的宽度为100%,而不会弄乱引导程序的媒体查询,或者还有其他或更好的方法来构建流体吗?引导程序3进行布局.

I've been playing with bootstrap 3 and I noticed that if you use the Grid System without a container it becomes fluid, someone told me I shouldn't do that because the system was design to be within a container. What happens if I don't use the container class?, do I need it?, if so could I make the container class width 100% without messing up bootstrap's media-queries, or is there any other or better way to build a fluid layout with bootstrap 3.

推荐答案

更新Bootstrap 4

在Bootstrap 4中,行也应该包裹在containercontainer-fluid中,以防止由.row上的负边距引起的水平倾斜.

Rows should also be wrapping in container or container-fluid in Bootstrap 4 to prevent horizontal scolling caused by negative margins on the .row.

引导程序3

您应该将row包裹在container中,否则BS 3用于row元素的负边距会出现问题.基本上row设计为位于容器内. 详细了解Bootstrap网格

You should wrap row in container or you'll have a problem with the negative margins that BS 3 uses for the row element. Basically the row is designed to be within a container. Read more on the Bootstrap grid

在Bootply上播放以下示例: http://bootply.com/83751

Play with this example on Bootply: http://bootply.com/83751

这篇关于Bootstrap Grid,我需要一个容器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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