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
贵阳到韶关卧铺火车票济南至酒泉火车票查询系统汉口到丹东火车时刻表邓州到北京火车票卧铺合肥到本溪火车时刻表查询贵阳到韶关卧铺火车票火车y530 座位汉口到丹东火车时刻表龙岩到潍坊火车时刻表洛河到淄博火车票德州倒余姚火车票汉口到丹东火车时刻表火车k971德州倒余姚火车票邓县到南宁火车票列表洛河到淄博火车票江苏到江西火车票多少钱葫芦岛到咸阳火车葫芦岛到咸阳火车衡阳至清远火车票价宁波到山西火车多少钱葫芦岛到咸阳火车龙岩到潍坊火车时刻表安顺至娄底火车时刻表查询系统惠州至四川南充火车票查询系统长汀南到到赣州火车时刻表惠州至四川南充火车票查询系统安顺至娄底火车时刻表查询系统衡阳至清远火车票价火车k971由华夏国科技小组首次研发的虚拟真人游戏《神域彼岸》一度火上国际,无数玩家纷纷开启异世界冒险,这款游戏展现的是真人第一视角,将自己的大脑意识传输到虚拟的空间中,来到异界开启战争、打怪、生存,争斗等各种玩法,一度登上国际热搜。 而男主高中生刚刚毕业,在接触到这款游戏时,从刚开始的成长到遇见领路人,在到带领省级争夺域主,之后,更是由于之前丰富的战斗经验,竟然成为了国际参赛员,将代表华夏国与其他国家开启一场虚拟竞技,带领着自己的队伍开启一场成王败寇的道路。 这也是一个唯美的爱情故事,女主双腿残疾本来是永远不会站起来的,但是在游戏里遇到了男主,二人通过一系列冒险和参加比赛,给了她信心,让她有了面对的勇气,到了最后完成了奔赴。“快来扶人!”无数人来这里“快打120!”“歪?120吗?快来这里有人出车祸了!”“歪110吗,这里有人出车祸了!”地上躺了个刚出车祸的人,在周围围了无数的群众,有人帮忙的有120、110的… “我这是死了吗?天堂还真别致呢!”“村长,他醒了,他醒了,一个女孩叫着旁边的一个大叔,小伙子你醒了?”“这是哪里?” “这是…”没等村长说完,又昏了过去… “你醒了?你还真是命大啊,车那么快你都能活下来,真是命大,不过你这辈子可能废了…”“我刚才做了一个好奇怪的梦,看见许多的,没见过的东西…”“这很正常,人要死了啥都能梦见,也说明你命好,捡回来一条命。”… “这不是梦境!” “我只是半滴血?和一缕残魂?” 单女主,但暂时没想好叫啥名。核毁灭后200年,失去家园的人类在浩渺的宇宙,建立了星际联盟。 魔格星囚徒索伦,无意中捡到了一个星际放逐舱,引来了无穷的追杀...... 在寻求真相的旅途中,他发现了......人在做,天在看,天知、地知,你知,我知!作恶者为非作歹,祸乱人间,躺赚不义之财,妄想游离于法网之外,欺天瞒地,逍遥自在,潇洒快活!殊不知,不是不报时候未到!天网恢恢,疏而不漏!恶者恒恶,善者永善,公道自在人心!XX年间,天下大乱,群妖四起,官兵横行,百姓民不聊生。 天上众神,心疼百姓,特派紫微星下界,斩妖除魔,匡扶正义,救黎明于水火。 紫微星领命,下到人间,化身一名女子,隐居山间,观察人间百态,看遍民间疾苦,可悲可叹!所思既所得 所想既所有——觉界所以屹立万界之巅,便因这独特而强力的位面法则。但当法则被撕碎,界灵被污染,又待谁来力挽狂澜?小小下界之子林韦,被迫卷入这场黑暗漩涡,又将翻起多少波澜? 长恨画戟不似月,一耀寒光洗九天。 一段七代传承中医人的故事,一首普通人的悲欢喜乐千人千面,千人一聚。白虎堂让素不相识的人聚在一起,有了羁绊,就有了意义。这是一个神奇的世界,要着不同的种族划分,无人类社会,全是以兽为核心价值观的一个起点,也可以理解为相似人类世界的其次元界一个在世上混了二十几年,一事无成的人,常年做着帝王梦。终于,梦醒了。他失眠了,精神分裂,住进了精神病院。万万没想到,他却因病而成网红,实现人生逆袭。可好景不长,这医院原来是穿越基地。他和病友们穿越了,穿越到一万年以后。
不剑不散 诡异复苏之我真的怕 轮回相杀 鄢国风云志:乾坤剑雨 梦中的我不同凡响 黄昏诸神说 赶上穿书赘婿热潮后 我的天哪! 重回晚清当皇帝 荒帝纪年 这是怎么回事 明月惊鹊 转生龙与精灵乱舞! 创世高武 洪荒之我是红云复活 大唐腾飞之路 诡事慢谈 我的新纪元 全职游戏设计师 超强豪盟 成都至扬州火车票价格 德州去郑州的火车票多少钱 江苏到江西火车票多少钱 合肥到本溪火车时刻表查询 成都至扬州火车票价格 昆明深圳多少火车票价? 江苏到江西火车票多少钱 广州至杭州火车硬卧 长汀南到到赣州火车时刻表 九江火车站d6350 龙井至松江河火车站 龙井至松江河火车站 安阳之韩城火车时刻表 德州去郑州的火车票多少钱 贵阳到韶关卧铺火车票 合肥到本溪火车时刻表查询 亳州至埠蚌火车 长汀南到到赣州火车时刻表 到徐州高铁火车时刻表查询 汉口到丹东火车时刻表 德州去郑州的火车票多少钱 汉口到丹东火车时刻表 到徐州高铁火车时刻表查询 葫芦岛到咸阳火车 洛河到淄博火车票 安阳之韩城火车时刻表 成都至扬州火车票价格 济南至酒泉火车票查询系统 到徐州高铁火车时刻表查询 长汀南到到赣州火车时刻表 合肥到本溪火车时刻表查询 漯河到莆田火车卧铺 邓州到北京火车票卧铺 贵阳到韶关卧铺火车票 安顺至娄底火车时刻表查询系统 惠州至四川南充火车票查询系统 邓州到北京火车票卧铺 江苏到江西火车票多少钱 安阳之韩城火车时刻表 邓县到南宁火车票列表 惠州至四川南充火车票查询系统 广州至杭州火车硬卧 贵定南站到凯里火车票查询 亳州至埠蚌火车 德州倒余姚火车票 漯河到莆田火车卧铺 龙井至松江河火车站 惠州至四川南充火车票查询系统 安阳之韩城火车时刻表 赣州到鹰潭火车票查询 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 世界劫 钓鱼修仙之路 我是世界最强的传说 破釜行 诸天副本:开局就是无敌潜力 亚星游戏官网 万利游戏官网 万利官网 亚星游戏官网 澳门葡京官网 洛河到淄博火车票 九江火车站d6350 亳州至埠蚌火车 衡阳至清远火车票价 惠州至四川南充火车票查询系统 成都至扬州火车票价格 贵阳到韶关卧铺火车票 宁波到山西火车多少钱 葫芦岛到咸阳火车 安阳之韩城火车时刻表 火车k971 火车k971 德州倒余姚火车票 漯河到莆田火车卧铺 惠州至四川南充火车票查询系统 合肥到本溪火车时刻表查询 汉口到丹东火车时刻表 广州至杭州火车硬卧 江苏到江西火车票多少钱 安阳之韩城火车时刻表 邓州到北京火车票卧铺 赣州到鹰潭火车票查询 贵定南站到凯里火车票查询 宁波到山西火车多少钱 合肥到本溪火车时刻表查询 安顺至娄底火车时刻表查询系统 九江火车站d6350 九江火车站d6350 贵定南站到凯里火车票查询 贵定南站到凯里火车票查询