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 as part of Bootstrap is a 940px-wide, 12-column grid.

It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.

<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

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="span12">
    Level 1 of column
    <div class="row">
      <div class="span6">Level 2</div>
      <div class="span6">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>
Variable Default value Description
@gridColumns 12 Number of columns
@gridColumnWidth 60px Width of each column
@gridGutterWidth 20px Negative space between columns
@siteWidth Computed sum of all columns and gutters Counts number of columns and gutters to set width of the .container-fixed() mixin

Variables in LESS

Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.

How to customize

Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.

Staying responsive

Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to customize the grids in responsive.less.

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>

Responsive devices

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: 768px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 980px) { ... }
// 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 hidding 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

Test case

Resize your browser or load on different devices to test the above clases.

Visible on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop

Hidden on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop
上海到浙江丽水汽车姚安到昆明的汽车时刻表上海到浙江丽水汽车2014年汽车限号桐庐到杭州汽车要多久深圳到肇庆汽车要多久兖州汽车站站长上海到浙江丽水汽车双流汽车票网上订票金城江汽车总站时刻表北京到乐陵长途汽车上海到浙江丽水汽车南宁到都安的汽车黄州汽车站绵阳到隆昌汽车时刻表金城江汽车总站时刻表芦台汽车站时刻表2014汽车运输2014汽车运输隆昌到昆明汽车遵义到印江汽车2014汽车运输双流汽车票网上订票长沙到冷水江的汽车桐庐到杭州汽车要多久寻乌到南康坐汽车要多久2014年汽车限号长沙到冷水江的汽车隆昌到昆明汽车南宁到都安的汽车神魔的游戏,养蛊人类,是举刀拿剑逆战万族,还是低眉俯首甘为奴仆,普通人的野望,你我是否都幻想过打破秩序,生与死,血与泪,离别与重逢,种种的选择,这是一部笑中含泪的作品,且看普通人如何末世中挣求活,选择自己的人生。 李江,一个不是这个世界的人来到了这个世界。他没有比别人更多的本事,唯一的长处就是他有别人永远都没有的经验。经验这个东西,可以让一个平凡的人成为神,不是神话里面的神。 李江,觉得自己不是神。他只是多了一点别人没有的记忆,这是老天爷的恩赐;或者是上帝的奖励。总之,他来了,带着神一样的能力,来到了这个世界。他不是来改变这个世界的,但是世界却要注定因他而改变! 哥不是神!但哥却可以成为神话!如今人类主宰大地,诸般神魔都已烟消云散? 考古发现的怪兽化石统统按上恐龙之名是不是太过敷衍? 摇着躺椅的文玩店小老板,仰望星空,对着圆月嘟囔着:“这一次,我们要做执刀人。”那一天,渤海大学钻了空子。 让两名黑人球员作为留学生外援,给大学联赛带来了噩梦,杀死了每个体育生的梦。 那一天,楚风重生归来,完美控场,永远以高对手一分的姿态主宰赛场,逐渐成为球坛的恐惧。还有多远才能进入你的心,还要多久才能和你接近 莽莽大荒异兽横行,人族蜗居一地,与天斗与兽斗,还要与人斗。经历无数纪元发展终能占据一方,一个偏居一偶的少年为了部落的生存励志成为强者,当一步步成长后才发现真正的天地更为壮阔,毅然走向远方。带着希望与梦,带着自己的伙伴一路前行。有着一群不为我们所知的人,他们被称为玄元者,他们生活在这个世界,却不与我们现同,他们的故事也鲜为人知。这是一份关乎很多人能否吃饱饭的工作,诞生得突然,根本没有可以学习的经验。但事情,总要有人去做。当困难降临,它会把我们捏成一个命运共同体。现在的S市,有很多有担当的人站了出来他们被称为“团长”。他们负责选品、集单、分发名单处理、维护群秩序组织志愿者运力,并带领志愿者送货到楼。启星的团长任命也是从这里开始…… 运筹帷幄算天下,一身修为定乾坤 以凡躯肉体血染苍穹,以无双智计扭转数国时局 震乾坤,逆生死 得至宝,夺造化 破万界,立天道 练就无上神通,击败无数强者,屹立在天道之上,自创天道,沐浴万灵,即是创天主宰。 “你知道吗,那是我经历过得最黑暗的一年!” 是啊,怎么能忘掉呢,好朋友死在她面前,她却什么都做不了,这已经成了她夜夜备受折磨的梦魇。 一年后她席卷重来,历史揭过,到底是谁又在一遍遍的保护着她,谁又是黑暗中那个毒蛇一般盯着她不肯放过的人?不管是谁她都要把人找出来。 有愧?仇恨?不!她是个警察,与邪恶本就是对立面,又怎会屈尊与黑暗?委身与邪恶? (新人写书,大家的鼓励就是我的兴奋剂!等着你们的留言呦~)
从普通人到先生 剑可开天 山村小仙农 一统异世 丰宁159师 我在魔法世界里横行霸道 胜利油田的三种精神 宗门养成:我的弟子都是主角模板! 神算异世 心道行 恶赎游戏 全球进入鬼灵复苏时代 云游散录 奔跑与呼唤 元灵法则 洪荒之开局炖了鲲鹏妖师 灵兵时代 金刚神帝 末日异能者公会 圣荒之主 苏州到金沙的汽车时刻表 青岛汽车北站网上订票 简阳到金堂汽车时刻表 黄州汽车站 苏州到金沙的汽车时刻表 清远中冠汽车站到深圳 简阳到金堂汽车时刻表 南宁到都安的汽车 长沙到冷水江的汽车 临沂到龙口的汽车 武夷山到泰宁汽车 武夷山到泰宁汽车 深圳到仁寿的汽车票 青岛汽车北站网上订票 绵阳到隆昌汽车时刻表 黄州汽车站 双流汽车票网上订票 长沙到冷水江的汽车 阆中到重庆汽车班次 临沂到汶上的汽车 青岛汽车北站网上订票 2014年汽车限号 寻乌到南康坐汽车要多久 鄄城到北京的汽车 山阴到太原汽车 深圳到仁寿的汽车票 长沙到冷水江的汽车 寻乌到南康坐汽车要多久 阆中到重庆汽车班次 长沙到冷水江的汽车 黄州汽车站 金城江汽车总站时刻表 桐庐到杭州汽车要多久 绵阳到隆昌汽车时刻表 长沙到冷水江的汽车 桐庐到杭州汽车要多久 临沂到汶上的汽车 芦台汽车站时刻表 清远中冠汽车站到深圳 绵阳到隆昌汽车时刻表 2014年汽车限号 山阴到太原汽车 深圳到仁寿的汽车票 简阳到金堂汽车时刻表 黄州汽车站 鄄城到北京的汽车 简阳到金堂汽车时刻表 2014年汽车限号 清远中冠汽车站到深圳 兖州汽车站站长 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 大明:最穷丞相,朱元璋:求求你贪污吧 驭术师 朋友圈被屏蔽就穿越了? 吞噬万族 铠甲勇士:我只想活下去! 百家乐官网 澳门葡京游戏官网 葡京官网 百家乐官网 万利游戏官网 临沂到龙口的汽车 南宁到都安的汽车 桐庐到杭州汽车要多久 寻乌到南康坐汽车要多久 隆昌到昆明汽车 2014汽车运输 北京到乐陵长途汽车 2014汽车运输 双流汽车票网上订票 黄州汽车站 青岛汽车北站网上订票 简阳到金堂汽车时刻表 临沂到汶上的汽车 深圳到肇庆汽车要多久 南宁到都安的汽车 姚安到昆明的汽车时刻表 苏州到金沙的汽车时刻表 阆中到重庆汽车班次 芦台汽车站时刻表 2014年汽车限号 北京到乐陵长途汽车 寻乌到南康坐汽车要多久 简阳到金堂汽车时刻表 芦台汽车站时刻表 深圳到肇庆汽车要多久 简阳到金堂汽车时刻表 遵义到印江汽车 隆昌到昆明汽车 遵义到印江汽车 青岛汽车北站网上订票