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
安农大驾校班车中山小榄广通驾校安庆市鼎立驾校电话安州驾校b2多少钱八五哪家驾校好安徽驾校报名费一览中山市驾校那家好安庆市鼎立驾校电话中山市南头镇联达驾校邹城圣地安德驾校有速成班吗自考对驾校的影响?安农大驾校班车中山南头驾校那个好巴彦淖尔市交通驾校网安庆市鼎立驾校电话邹城圣地安德驾校有速成班吗中山市南头广兴驾校巴彦淖尔市交通驾校巴彦淖尔市交通驾校安徽大学附近驾校中山市协成驾校巴彦淖尔市交通驾校中山市南头镇联达驾校安徽安顺驾校官网八五哪家驾校好中州驾校科二考场图安州驾校b2多少钱安达保过的驾校安徽安顺驾校预约三中山南头驾校那个好 【本书纯属虚构,不要较真,看着开心就好,最好不带脑子(狗头)】 【穿越+系统+爽文+无女主】 礼鹤因为车祸去世了,成了反派,还绑定了“反派系统”。 又从系统那得知要集齐1亿积分才能回到他原来的世界。 不过他能够一直穿越,直到集齐1亿积分,回到他原来的世界。 “叮,恭喜宿主完成任务,奖励10000免死金牌。” “叮,恭喜宿主完成任务,奖励10000黄金。” “叮,恭喜宿主完成任务,奖励10w积分。” “叮,恭喜宿主完成任务,奖励……” 终南山,烟雾萦绕间有一座寺庙 世界各地的名流高层,对这座小庙趋之若骛,只因这里坐着一位天之娇子。 但这位名叫张易的年轻人名满天下,但却无人识其长相。 如今,老爷子命其下山赴婚约,高手出山,天下将为之一变!“天下苍生,于我身后,活下去!” 他,人皇传承者,承载三界生的希望。 他,冰封数千年后醒来,仍不忘守护的誓言。 他,不喜杀戮,却不得不在血雨中成长。 他,以一页纸张,汇聚众生意志,护佑苍生。 这个人间,需要英雄! “幼稚吗?那就让我继续幼稚下去吧,只要人间还有笑容,只要苍生还有归处!” “我,韩羽,立道于苍生之上,护佑于苍生之前!”叶轻其人,自诩为“赏金猎人,”倚刀笑傲于世间,不求闻达于江湖。访友中,无意发现好友落入惊天之阴谋。其间,既有红颜知己的不离不弃,亦有肝胆相照的对手相伴于身旁;名门正派或是奸诈之辈,出身草莽却有热血男儿。危机之中,叶轻凭借缜密之心思、绝世之武功,不但识破江湖枭雄的各种阴谋,更是揪出阴谋背后的幕后主使,只是没有料到,这场阴谋已不限于江湖的仇杀,更是牵扯出二十余年前涉及皇族的惊天秘密。 一切的阴谋源于内心的膨胀,内心的膨胀则始于对金钱、权力无度的欲望。当阴谋如泡沫般被戳破后,江湖便如雨后的晴空,一切阴霾都被洗涤一空。在美好的日子里,付出努力的人自然也会收获属于他们的快乐。现代青年张无忌一次考古中,意外发现一座古墓。在古墓的神奇力量之下,竟来到了倚天之中的元朝末世。身怀北冥神功,逍遥传承,且看他如何在这个世界掀起风云,红颜相伴,兄弟相随,开辟出一个煌煌盛世! 注:本书单女主,不喜勿入!少年张玄某一天偶获异能从此改变了他平凡的人生. 能够轻易撕裂敌人的利爪 一拳轰爆坦克的能量锤 自由翱翔在天空的滑翔 轻易摧毁飞机的鞭拳头 ...各种异能让他成就非凡! 让我们来看张玄如何收服众美女完美逆袭刘家是赤水一个不起眼的修仙家族,俗话说匹夫无罪怀璧其罪,自从刘家从赤水深渊秘密探宝回来,就被各大势力盯上,尤其是颍上修仙大族高家,不惜发动灭族大战也要夺取刘家得到的宝物。刘家因宝惹的家破人亡,只得刘墨林等几名刘家后辈在家族前辈的掩护下逃脱重围。只看我们主角刘墨林怎么样为家族复仇,在修仙路上成长。。三个穷困少年逆袭成功的故事 如果除去天生阴阳眼的话,我的前半生应该是普通的不能再普通了,但自从那天之后,我墨色的生活被染上了色彩。这个世界文道为尊,文人掌文箓,修文气,开文宫。 九品开窍文箓,一目十行,身轻体健。 八品修身文箓,文字加身,如有神助。 七品仁者文箓…… “诗词歌赋,笔墨丹青,棋艺话本这些你都懂?” “略懂略懂。” “都懂一点也行。” “是亿点点……” 官居一品,权倾朝野? 封王拜相,永享荣华? 不不不,身怀国家图书馆全部资料的李长安,无奈接受了,世人把他名字刻进圣庙的事实。
天狼星之落花传说 罪恶城下星净土 剑自雪中来 从夺舍开始的人生 逆灭时空 在异世界闹革命 在人间修炼的日子 明月寒君 精灵从上古进入全世界 二十世纪零十一青春正好 神无之界 我们的神族 终末序列 离开了幽村,没人和我说话 叱咤弥界之我的小命我做主 命之途 幻役 我的宠兽都有外挂 传奇之路:天选者 媒介收容所 中阳县驾校 自考对驾校的影响吗 中山市南头广兴驾校 巴彦淖尔市交通驾校 中阳县驾校 阿克苏驾校科目四考试中心 中山市南头前程驾校 租赁驾校场地 中州驾校科二考场图 中山南头驾校那个好 中山市南头镇联达驾校 中山市南头一新驾校 安徽安顺驾校官网 邹城圣地安德驾校有速成班吗 安徽驾校报名费一览 八五哪家驾校好 中山市南头前程驾校 中州驾校科二考场图 中山市协成驾校 安农大驾校班车 自考对驾校的影响吗 安庆市鼎立驾校电话 中山小榄广通驾校 巴彦淖尔市交通驾校网 邹城圣地安德驾校有速成班吗 安徽安顺驾校官网 中州驾校科二考场图 中山小榄广通驾校 中山市协成驾校 中州驾校科二考场图 八五哪家驾校好 自考对驾校的影响吗 安翔驾校一点通 安农大驾校班车 安达保过的驾校 八五哪家驾校好 安翔驾校一点通 中山市南头广兴驾校 安徽安顺驾校官网 安翔驾校一点通 八五哪家驾校好 中山南头附近驾校 安徽大学附近驾校 中山市南头一新驾校 巴彦淖尔市交通驾校网 自考对驾校的影响吗 中山市南头一新驾校 安州驾校b2多少钱 安徽安顺驾校预约三 中山市驾校那家好 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 最后的落日川 幻想手册 宇宙第一武者 天御族1统筹 三国,想成仙,被曹操赐婚 欧博官网 百家乐官网 亚星管理平台 欧博官网 亚星游戏官网 阿克苏驾校科目四考试中心 中阳县驾校 巴彦淖尔市交通驾校 中州驾校科二考场图 安徽安顺驾校官网 八五哪家驾校好 安徽安顺驾校预约三 阿克苏驾校科目四考试中心 安徽驾校报名费一览 中山市南头前程驾校 租赁驾校场地 中山市南头一新驾校 安庆市鼎立驾校电话 安徽大学附近驾校 安翔驾校一点通 租赁驾校场地 八五哪家驾校好 安翔驾校一点通 阿克苏驾校科目四考试中心 安州驾校b2多少钱 自考对驾校的影响? 中山市驾校那家好 自考对驾校的影响? 八五哪家驾校好 邹城圣地安德驾校有速成班吗 安徽安顺驾校官网 安徽驾校报名费一览 安徽大学附近驾校 中山南头驾校那个好 自考对驾校的影响吗