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
长沙铁炉寺电话 价格荣成w丽景酒店电话三亚飞机场电话号码茨坝邮政编码电话湖南旅游办公室电话长沙铁炉寺电话 价格下山口温泉经理电话三亚飞机场电话号码绵阳体育电话号码太原市悦宾酒店电话亳州宠物店电话是多少钱三亚飞机场电话号码回游客客服电话亳州宠物店电话是多少钱深圳到新野车联系电话太原市悦宾酒店电话温州永和豆浆外卖电话滨州到日照的汽车电话滨州到日照的汽车电话苏家屯客运站咨询电话好易订团购客服电话滨州到日照的汽车电话绵阳体育电话号码香天下退卡电话沁水端氏永利酒店电话奉节皇都洗浴前台电话沁水端氏永利酒店电话香天下退卡电话苏家屯客运站咨询电话回游客客服电话秦风被迫从游戏界龙头企业辞职后,加入了一家只有几个人的小公司。 制作游戏,我秦风还没服过谁。 看不起小游戏?《开心消消乐》《神庙逃亡》教你做人。 单机游戏没落了?仙剑系列,魂系游戏,剧情或难度,总有一款玩哭你。 网游模式单一?LOL,绝地求生,自走棋,这回不是打怪升级了吧? 就凭做游戏,也能做首富! 不信?做给你看!身怀不临世间法的百草小师叔郭玉磊,在某一天,带着一柄剑,一头猪,走下了终南山! 开始了他的传奇人生。 医术,可让大佬俯首,一针,可令百媚投怀。 以身为炉,炼化乾坤。以剑为坟,埋仙葬神! 武灵大陆,强者为尊,主角本以为有神秘老师相助会平步青云,踏上成为强者之路,但让他没成想到的是...... 异元新生(又名双生) 这是一个平行世界。 我不是我,一样的人,不一样的世界,不一样的行迹轨道。   异世界,原世界之间存在着一可以修炼的不同之处。      寒星雨18岁生辰,意外身陨家中,醒来后,并不知道自己来到了平行世界中,同一时间线,自己小时候的身上。   这是一个异世界,与原世界只有部分的人事物相同,但是却是多了一个名为时灵师的修炼者。   这个次元的人大多都可以修炼,唯独他是一个个例,天生废体,无法修行,但他却是觉得修炼是枯燥的。   直到有一天,才知晓自己的身上发生的事情,原来他可以通过修炼回归原来的世界,否则命不久矣。   知道自己天众之资,才悔之晚矣……黑暗降临,世界处处充斥着恐怖的怪物与邪灵。 面对妖邪鬼魅,普通人只能蜷缩在角落瑟瑟发抖,等待救援或者祈求上苍。 而叶秦逆天而行,觉醒金光霸体系统,以武学增强自身,以肉身横推诸天! 寸拳、弹腿、金刚指……通通满级。 谁说武功杀不死妖邪?叶凡上一世的仙王老婆重生归来,找到叶凡带他走上修仙路。 斩魔帝,斗五宗,破天穹,打开仙路,直杀天穹,带领全民修仙。 我的时代谁敢称无敌!上来一战! 以双修正道!浩瀚宇宙分为三千世界。 一部天经遗落凡尘,顿时风起云涌,诸天万界竞相窥探。 少年走出一域,拔剑而起,破万道,冲星河。林洛在上班回家途中被异界召唤系统砸中所穿越的故事。我乃计都星下凡,先天便拥有阴阳眼。未出生就遭人算计,不足月被人挖出母体,先天有缺,易招恶鬼,命格犯煞,注定活不过百日。在奄奄一息之际,幸得牛四海相救,从此跟随其生活在一起,耳濡目染,终成一方守界人,自此可与神灵交流,可随意出入地府,逆天改命!外界干预下为地球带来的快速进化是灾难,还是福音。
规则动乱 我!帝皇侠!胖揍钢铁侠 云海天涯剑 梦卜仙 原神之我到提瓦特对线天理 玄幻:我能查看万物词条 天亘世修 游戏转生者与梦拉幻大陆 象爸来信第一部神话时代 特种兵之最强国术系统 侠殇天下之练功系统 大秦:开局欠始皇百万黄金 入赘女婿如何受气 小老虎大冒险 前哨基地 异能者:荒诞游戏 消逝的荣耀 别吓我!话疗吧 程序员修真之旅 改香传 上海曼森精品酒店电话 宅急送电话香港 温州永和豆浆外卖电话 湖南旅游办公室电话 上海曼森精品酒店电话 红砖美术馆婚礼电话 温州永和豆浆外卖电话 大庆普利司通轮胎电话 奉节皇都洗浴前台电话 西安高铁服务站电话 窖口客运站 电话 窖口客运站 电话 长春市宽城区新发街道北京大街社区服务电话 宅急送电话香港 长沙铁炉寺电话 价格 湖南旅游办公室电话 尤溪出租车电话321321 奉节皇都洗浴前台电话 桃园晶悦国际饭店 电话 三亚飞机场电话号码 宅急送电话香港 深圳到新野车联系电话 桃园晶悦国际饭店 电话 亳州宠物店电话是多少钱 太原市悦宾酒店电话 长春市宽城区新发街道北京大街社区服务电话 上海曼森精品酒店电话 荣成w丽景酒店电话 桃园晶悦国际饭店 电话 奉节皇都洗浴前台电话 湖南旅游办公室电话 临沂青岛客车电话是多少 茨坝邮政编码电话 长沙铁炉寺电话 价格 香天下退卡电话 沁水端氏永利酒店电话 茨坝邮政编码电话 温州永和豆浆外卖电话 长春市宽城区新发街道北京大街社区服务电话 深圳到新野车联系电话 沁水端氏永利酒店电话 西安高铁服务站电话 816地下核工程联系电话 尤溪出租车电话321321 亳州宠物店电话是多少钱 临沂青岛客车电话是多少 窖口客运站 电话 沁水端氏永利酒店电话 长春市宽城区新发街道北京大街社区服务电话 下山口温泉经理电话 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 十主传 食灵者 七界修仙录 人化灵传 工业革命从仙武大秦开始 亚星管理平台 万利游戏官网 万利官网 亚星游戏官网 亚星官网 回游客客服电话 沁水端氏永利酒店电话 南航改签客服电话是多少 尤溪出租车电话321321 红砖美术馆婚礼电话 窖口客运站 电话 下山口温泉经理电话 好易订团购客服电话 亳州宠物店电话是多少钱 太原市悦宾酒店电话 临沂青岛客车电话是多少 上海曼森精品酒店电话 绵阳体育电话号码 上海曼森精品酒店电话 三亚飞机场电话号码 茨坝邮政编码电话 上海曼森精品酒店电话 下山口温泉经理电话 茨坝邮政编码电话 滨州到日照的汽车电话 湖南旅游办公室电话 苏家屯客运站咨询电话 香天下退卡电话 临沂青岛客车电话是多少 尤溪出租车电话321321 好易订团购客服电话 绵阳体育电话号码 大庆普利司通轮胎电话 816地下核工程联系电话 茨坝邮政编码电话