1
1
1
1
1
1
1
1
1
1
1
1
4
4
4
4
8
6
6
12

The default grid system provided in Bootstrap utilizes 12 columns that render out at widths of 724px, 940px (default without responsive CSS included), and 1170px. Below 767px viewports, the columns become fluid and stack vertically.

<div class="row">
    <div class="span4">...</div>
    <div class="span8">...</div>
</div>

As shown here, a basic layout can be created with two "columns", each spanning a number of the 12 foundational columns we defined as part of our grid system.


Offsetting columns

4
4 offset 4
3 offset 3
3 offset 3
8 offset 4
<div class="row">
    <div class="span4">...</div>
    <div class="span4 offset4">...</div>
</div>

Nesting columns

With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new .row and set of .span* columns within an existing .span* column.

Example

p>Nested rows should include a set of columns that add up to the number of columns of it's parent. For example, two nested .span3 columns should be placed within a .span6.

Level 1 of column
Level 2
Level 2
<div class="row">
     <div class="span6">
        Level 1 column
        <div class="row">
            <div class="span3">Level 2</div>
            <div class="span3">Level 2</div>
        </div>
    </div>
</div>

Fluid columns

1
1
1
1
1
1
1
1
1
1
1
1
4
4
4
4
8
6
6
12

Percents, not pixels

The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.

Fluid rows

Make any row fluid simply by changing .row to .row-fluid. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.

Markup

<div class="row-fluid">
    <div class="span4">...</div>
    <div class="span8">...</div>
</div>

Fluid nesting

Nesting with fluid grids is a bit different: the number of nested columns doesn't need to match the parent. Instead, your columns are reset at each level because each row takes up 100% of the parent column.

Fluid 12
Fluid 6
Fluid 6
<div class="row-fluid">
    <div class="span12">
        Level 1 of column
        <div class="row-fluid">
            <div class="span6">Level 2</div>
            <div class="span6">Level 2</div>
        </div>
    </div>
</div>

Fixed layout

The default and simple 940px-wide, centered layout for just about any website or page provided by a single <div class="container">.

<body>
    <div class="container">
        ...
    </div>
</body>

Fluid layout

<div class="container-fluid"> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span2">
            <!--Sidebar content-->
        </div>
        <div class="span10">
            <!--Body content-->
        </div>
    </div>
</div>

What they do

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

  • Modify the width of column in our grid
  • Stack elements instead of float wherever necessary
  • Resize headings and text to be more appropriate for devices

Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.

Supported devices

Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:

Label Layout width Column width Gutter width
Smartphones 480px and below Fluid columns, no fixed widths
Smartphones to tablets 767px and below Fluid columns, no fixed widths
Portrait tablets 768px and above 42px 20px
Default 980px and up 60px 20px
Large display 1200px and up 70px 30px

Requires meta tag

To ensure devices display responsive pages properly, include the viewport meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Using the media queries

Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:

  1. Use the compiled responsive version, bootstrap-responsive.css
  2. Add @import "responsive.less" and recompile Bootstrap
  3. Modify and recompile responsive.less as a separate file

Why not just include it? Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.

  /* Landscape phones and down */
  @media (max-width: 480px) { ... }
  /* Landscape phone to portrait tablet */
  @media (max-width: 767px) { ... }
  /* Portrait tablet to landscape and desktop */
  @media (min-width: 768px) and (max-width: 979px) { ... }
  /* Large desktop */
  @media (min-width: 1200px) { ... }

Responsive utility classes

What are they

For faster mobile-friendly development, use these basic utility classes for showing and hiding content by device.

When to use

Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.

For example, you might show a <select> element for nav on mobile layouts, but not on tablets or desktops.

Support classes

Shown here is a table of the classes we support and their effect on a given media query layout (labeled by device). They can be found in responsive.less.

Class Phones 480px and below Tablets 767px and below Desktops 768px and above
.visible-phone Visible
.visible-tablet Visible
.visible-desktop Visible
.hidden-phone Visible Visible
.hidden-tablet Visible Visible
.hidden-desktop Visible Visible
江苏南通至郑州火车时刻表郑州到仪征的火车站哈尔滨直达满洲里火车卧铺铜川至太原火车唐山丰润火车站时间表江苏南通至郑州火车时刻表d941火车票哈尔滨直达满洲里火车卧铺佛山到赣州火车票价北京到银川有几趟火车站张家口火车代售江苏南通至郑州火车时刻表上海火车站到杨浦区红房子怎么走张家口火车代售哈尔滨直达满洲里火车卧铺福州火车站热线唐山到晋中火车唐山丰润火车站时间表唐山丰润火车站时间表网上火车票抢票软件福州至宁波的火车时刻表厦门到武隆有火车吗佛山到赣州火车票价T21火车在窗口无锡 舟山 火车站时刻表火车g2924铜川至太原火车石家庄火车站买票点网上火车票抢票软件上海-西宁火车票另一个世界故事发生于2010年某个夜黑风高的停电夜,在一处“荒废”老宅里发生的一系列事情。男主一家三口在连续经历了偷窃、双亲亡故、惊魂托梦、祖产纠纷、假遗嘱、跟踪等一系列变故,最终不堪其扰搬离老宅。那些为了钱财可以抛弃手足情长的坏家伙,能轻易放过他们一家三口吗? 九檀大陆,三族鼎立,但是随着时间的推移,人族腐败衰落,鬼族为了重获新生化身为鬼器,兽族兽皇退位…… 但是,在兽皇嫡子的带领下,兽族愈加昌盛,统领兽族的九檀氏族,成为大陆第一家族。急急急,修为高深的仙子要杀我,怎么破局?! “系统已切换成攻略版本,助宿主攻略成功。” 急急急,收不到天姿绝顶的弟子怎么破?! “系统已切换成最强师徒养成版本,为您保驾护航,助宿主登顶最强。” 曾浩重生到北宋水浒世界,竟成为武大郎! 还好,此刻的潘金莲还是单纯小可爱,西门庆还没有出现。 他誓要改变武大郎悲惨的命运! 收服各路梁山好汉,利用梁山好汉们独特的本领不断扩大自己的势力。 与神医安道全发展医药业; 与林冲、索超、呼延灼等好汉发展物流运输与边境贸易; 与浪子燕青、铁叫子乐和发展娱乐业…… 一人,一妻,一国。诏安的惨剧将不会重演! 曾浩要让所有看不起武大郎的人都知道,什么叫降维打击!废柴?退婚?绑定作死系统?作死就能变强? 叶天尘:想当年作死的过程多么快乐,可是一晃眼…… 轰隆隆!(仙帝法决袭来) 叶天尘:还是那么快乐! 只要杀不死我,我就能变强读了红楼梦,每个人心里都有一个红楼“梦”.... 这是一个平平无奇,不知所谓,符合环境,普通凡人版的文艺梦。曾为前世顶尖杀手的姜扬,因为人的贪欲转生至异世界,将整个世界带到万劫不复之地,成为‘魔主’主角降生之日,被称为‘魔临之日’!两炎黄子孙。 网吧猝死。 魂穿神狼。 身负系统。 一者升级系统。 一者万能系统。 原是铁哥们。 今成双父子。 一为帝。 一为帝他爹。 帝坑爹变强。 爹纳妃三千无敌。 二人相坑相杀。 面对强敌。 哪怕万级大佬。 莫慌。 有爹在。 都是阿猫阿狗。 本书有些无厘头,偏搞笑。 开车~ 你懂的。 还不懂? 给你个表情自己体会。 ヽ(爱′?‘爱)ノ 本作品是一部相对严肃、严谨的历史小说,讲述的是夏商之交夏、商斗争的故事。本书收集了古书中关于夏商之际所有记载,包括近年来公布的出土文献的记载及部分历史研究和考古资料,其中既有历史记载也有神话传说,通过演绎和艺术加工,详细讲述夏商之际的故事,结构宏大,内容丰富,既有曲折的故事,也有很多的知识点,读了不会让您失望。
凉城小炮灰 转生之都市霸主 原子打印 有风自南落长安 巫门相医 仙尘异行 奥特:救赎之光 烟火Fireworks 铁血之人的无限之旅 南楚门客 暮虎识香 浮沉河海 九域覆灭录 小王的成长故事 小道游人间 鬼怨校园:噩梦 爱丽丝在1918 天道: 怪化巫医 与水浒共进退 唐山到晋中火车 哈尔滨直达满洲里火车卧铺 九台到安徽阜阳火车站时刻表 沙城到广水火车站时刻表 d941火车票 杭州到昆明的火车线路 九台到安徽阜阳火车站时刻表 铜川至太原火车 临河到永登火车票 无锡 舟山 火车站时刻表 北京到银川有几趟火车站 北京到银川有几趟火车站 耒阳市到南宁火车 哈尔滨直达满洲里火车卧铺 郑州到仪征的火车站 T21火车在窗口 福州火车站热线 唐山到晋中火车 上海-西宁火车票 火车g2924 江苏南通至郑州火车时刻表 火车g2924 上海-西宁火车票 网上火车票抢票软件 火车好还是动车 佛山到赣州火车票价 唐山到晋中火车 上海-西宁火车票 上海-西宁火车票 临河到永登火车票 沙城到广水火车站时刻表 江苏南通至郑州火车时刻表 石家庄火车站买票点 郑州到仪征的火车站 耒阳市到南宁火车 T21火车在窗口 石家庄火车站买票点 九台到安徽阜阳火车站时刻表 耒阳市到南宁火车 泸州到仁怀的火车 无锡 舟山 火车站时刻表 广州到汉口火车票硬卧 网上火车票抢票软件 杭州到昆明的火车线路 张家口火车代售 九台到安徽阜阳火车站时刻表 耒阳市到南宁火车 无锡 舟山 火车站时刻表 沙城到广水火车站时刻表 唐山到晋中火车 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 猎灵士 太空论 断义恩肠 他老人家的小祖宗 彼云端 百度 百度 百度 百度 百度 福州至宁波的火车时刻表 网上火车票抢票软件 郑州到仪征的火车站 福州至宁波的火车时刻表 无锡 舟山 火车站时刻表 郑州到仪征的火车站 石家庄火车站买票点 火车好还是动车 石家庄火车站买票点 火车g2924 沙城到广水火车站时刻表 d941火车票 福州火车站热线 临河到永登火车票 江苏南通至郑州火车时刻表 T21火车在窗口 江苏南通至郑州火车时刻表 福州火车站热线 火车好还是动车 江苏南通至郑州火车时刻表 郑州到仪征的火车站 火车好还是动车 唐山丰润火车站时间表 上海-西宁火车票 唐山丰润火车站时间表 铜川至太原火车 九台到安徽阜阳火车站时刻表 石家庄火车站买票点 沙城到广水火车站时刻表 T21火车在窗口 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网