如果我在 Bootstrap 3 中使用 .container-fluid,这是否意味着我需要使用网格类? [英] If I use .container-fluid in Bootstrap 3, does that mean I need to use grid classes?

查看:20
本文介绍了如果我在 Bootstrap 3 中使用 .container-fluid,这是否意味着我需要使用网格类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了几个关于 .container.container-fluid 是什么的 SO 答案,但我缺少的很简单.如果我使用 .container-fluid,我是否使用 col-xs-6、col-md-9 等列类?resize 和 .container 都执行特定的大小,这就是我使用 col-xx 类的原因,但是 .container-fluid 会一直调整所有内容的大小,因此 .container-fluid 会自动处理列大小,我信任"做对了吗?

解决方案

container-fluid 用于包含网格(row + col-*)但可用于其他内容,例如标题、表格等..

所以不,container-fluid 不是列的替代品,它是列的持有者.container-fluidcontainer 的唯一区别在于 container 在大屏幕上不是全角.container 是一个固定宽度,以大边距为中心.container-fluid 不会调整大小,它总是 100% 宽度.容器演示

如果你想使用响应式网格(行和列),你需要像这样使用容器或容器流体..

<div class="row">(此处有一个或多个 col-*-*)

或者

<div class="row">(此处有一个或多个 col-*-*)

阅读这篇文章以获得完整的解释.

I've read several of the SO answers to what .container and .container-fluid are, but what I am missing is simple. Do I use column classes like col-xs-6, col-md-9, etc., if I am using .container-fluid? Both resize and .container does it specific sizes, which is why I use the col-x-x classes, but .container-fluid resizes everything all the time, so does .container-fluid take care of the column sizing automatically and I "trust" it gets it right?

解决方案

The container-fluid is used to contain the grid (row + col-*) but can be used for other things such as headings, tables, etc..

So no, container-fluid is not a replacement for columns, it's a holder of columns. The only difference between container-fluid and container is that the container is not full-width on larger screens. The container is a fixed width that's centered with large margins on the sides. container-fluid doesn't resize, it's always 100% width. Container demo

If you want to use the responsive grid (rows and columns), you need to use container or container-fluid like this..

<div class="container-fluid">
    <div class="row">
        (one or more col-*-* here)
    </div>
</div>

Or

<div class="container">
    <div class="row">
        (one or more col-*-* here)
    </div>
</div>

Read this article for a complete explanation.

这篇关于如果我在 Bootstrap 3 中使用 .container-fluid,这是否意味着我需要使用网格类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆