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
陆丰市佑安驾校计时洛阳那个驾校可以考c2没学过车考驾校要多久梅州丰顺驾校多少钱梅州驾校报名多少钱陆丰市佑安驾校计时闵行区七宝镇驾校没学过车考驾校要多久洛阳驾校排行榜密云第二驾校在哪里梅州五华驾校价格没学过车考驾校要多久闵行旗忠驾校学费梅州五华驾校价格眉山市有什么驾校密云第二驾校在哪里罗定顺安驾校 收费梅州市粤东驾校梅州市粤东驾校庐江驾校 科目一洛阳邙山驾校B照梅州市粤东驾校洛阳驾校排行榜玛雅驾校哪个场地好梅州各驾校报名费摩托驾校梅州各驾校报名费玛雅驾校哪个场地好庐江驾校 科目一闵行旗忠驾校学费一次善意的无心之举,一块看似普通的玉石 惨淡少年,命运的转折点 校园反霸,商界称王 扮猪打脸,纵横四方 萝莉御姐,高冷女皇 从此一路开挂,快意恩仇,踏上属于自己的最强之路! 描写一个普通打工者的路程他是国之重器,科研天才,国士无双! 她是国民女神,国色天香,迷倒众生。 重生到另一个世界的洛铭,激活了系统。系统给予的奖励条件为暗恋,暗恋时间越长,奖励越丰厚。 谨慎选择了自己的暗恋对象云雨蝶之后,经历五年时光,作为可控核聚变,空天航母,外骨骼机甲等高端科研项目总工程师的洛铭,载誉归来。 而他不知道的是,在不久之前,已经成为国民女神,甜美天后的云雨蝶竟然在歌手巅峰对决节目中向他表白了。 原来这个可爱的女神,也在暗恋着洛铭。 五年一别,五年暗恋,五年思念,再次相逢,这对神仙眷侣开始谱写传奇而甜蜜的人生!天族小殿下惊天落难,被隐士老人古月所救,从此她身边多了一个陪伴的人,两人相互帮助、相互慰藉,两小无猜,青梅竹马,他说过长大以后要娶自己,为了能让她活着,惊天独闯龙潭虎穴寻地火,一人大战千人得阴风珠,然而命运捉弄相爱的人,应为身份差距分开。为了能见到他,为人能和他在一起。她吞地火,食阴风珠,闯地狱得寒冰神髓,过关斩将得天火,历经千辛万苦成为世界强者,她满坏欣喜的去找他,却发现他要大婚了,无数次幻想的新娘不是自己,他们会不会在一起,请看王静如的寻夫之旅,谨此,回忆初中三年,故事可能不会太多,以此纪念我的初中生活以及学校 (学校邻导找不到,若此作损害了学校利益,学校领导只要说了我可以及时改正,甚至删除本作品)(衡水志臻学校清河校区)感谢!!!两百年前,社会黑暗,生灵涂炭,盗匪崛起,沿海百姓深受海盗骚扰,为了保护族人安危,沿海小镇‘关口镇’的百姓揭竿而起,成为海盗,抢来了能够独霸海域的萨伽索号船,让关口镇百姓过上富裕生活。而关口镇人民为了独享财富,也为了让子孙摆脱海盗的身份,他们勾结政府,背叛了一直为了他们而在海上厮杀的‘海盗’神说:太初有道,道即是神! 魔曰:太初有道,魔于道先! 有魔,先于道而生!这不仅仅是某人的自夸,更牵扯到他证道的隐秘。 九州之变,魔星降世,灵石下凡,洪荒秘闻…… 道之所存,魔之所在!且看天魔周游各方世界,追逐魔之本源,成就无上道果! 天地初开,天河降世,地脉翻涌,两条大脉为世界源头。两脉之间是为蛮荒,不知多久岁月蛮荒之中出现一生物,因在两脉之间被称之为人。又因弱小因此又称人奴。 天河中的生物为神,地脉中的生物为魔,人族为棋子参与人魔之战,又因不想为奴发生人神之战。惨败后的人族自囚于白骨山脉。 一少年因意外穿越白骨山脉,知晓人魔之战的原因,领略了人神之战的悲壮,看少年如何在这精彩的世界,活出自己的精彩。 人族圣君秦昊天,在即将突破修真至高境界之际,遭到属下背叛,含恨陨落,以苍蓝星凡人云天佑的身份重获新生。 “帝君本无种,男儿当自强,我命由我不由天!” 不屈从命运安排的他,决心再踏仙途,夺回失去的一切...御灵者,上古巨兽,兽人,人兽,异能者,素国武者,传说中的龙族,随着世界联赛的开始,背后的阴谋拉开了序幕……
我和冷傲女友想好好恋爱 至道眼 日破苍穹 腥红轮回 小黑屋全勤码字交流群 十方境灭 重生:回到1992当土豪 被闪电击中意外获得异能 参生 陆地剑仙:剑阁守剑八十年 疯了!代课两月,竟全考985 世界间 刚穿越的我差点被饿死 弑神:从杀死秦始皇开始 穿越多年我竟是反派? 天界重生异能者 黑色余火 外围高手 路人不曾想过的青春 如果没有你出现,会怎样 哪个驾校有陪练 密云第二驾校在哪 罗定顺安驾校 收费 梅州驾校报名多少钱 哪个驾校有陪练 玛雅驾校电话城关区 罗定顺安驾校 收费 绵阳哪个驾校有车转让 摩托驾校 闵行旗忠驾校到银春路 洛阳鸿运驾校科二报名 洛阳鸿运驾校科二报名 隆回友谊驾校vip班 密云第二驾校在哪 陆丰市佑安驾校计时 梅州驾校报名多少钱 洛江河市驾校考试场 摩托驾校 洛阳邙山驾校官网 没学过车考驾校要多久 密云第二驾校在哪 眉山市有什么驾校 洛阳邙山驾校官网 梅州五华驾校价格 密云第二驾校在哪里 隆回友谊驾校vip班 摩托驾校 洛阳那个驾校可以考c2 洛阳邙山驾校官网 摩托驾校 梅州驾校报名多少钱 每个驾校考场都一样吗 梅州丰顺驾校多少钱 陆丰市佑安驾校计时 玛雅驾校哪个场地好 梅州驾校报名多少钱 梅州丰顺驾校多少钱 罗定顺安驾校 收费 隆回友谊驾校vip班 眉山市有什么驾校 梅州各驾校报名费 闵行旗忠驾校到银春路 鲁航驾校报名电话 洛江河市驾校考试场 梅州五华驾校价格 每个驾校考场都一样吗 洛阳鸿运驾校科二报名 梅州各驾校报名费 隆回友谊驾校vip班 闵行区七宝镇驾校 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 佛之手 邪道圣人 我出生带有魔道圣体 封闻大陆 从特种兵开始融合万物 欧博游戏官网 皇冠登3出租 百家乐官网 欧博游戏官网 亚星管理平台 庐江驾校 科目一 陆丰市佑安驾校计时 梅州各驾校报名费 梅州市粤东驾校 绵阳哪个驾校有车转让 洛阳那个驾校可以考c2 庐江驾校 科目一 洛江河市驾校考试场 摩托驾校 闵行区驾校哪家好 陆丰市佑安驾校计时 洛阳邙山驾校官网 梅州五华驾校价格 梅州五华驾校价格 没学过车考驾校要多久 眉山市有什么驾校 庐江驾校 科目一 鲁航驾校报名电话 玛雅驾校电话城关区 梅州驾校报名多少钱 密云第二驾校在哪里 洛阳邙山驾校官网 隆回友谊驾校vip班 密云第二驾校在哪 哪个驾校有陪练 闵行区驾校哪家好 鲁航驾校报名电话 洛阳邙山驾校B照 梅州市粤东驾校 梅州市粤东驾校