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
信用卡不激活会影响信用吗中国邮政储蓄银行信用卡账单日长城金信用卡介绍信用卡还款日是17县医院刷信用卡属于合理用卡吗?信用卡不激活会影响信用吗18岁没工作能办信用卡吗长城金信用卡介绍邮政信用卡还款日分期中行环球港澳台版信用卡额度多少长城环球通信用卡申请表信用卡不激活会影响信用吗信用卡中介能办出来吗?东莞农商银行 信用卡长城金信用卡介绍中行环球港澳台版信用卡额度多少超过65岁补发信用卡中国银行长城环球通信用卡金卡额度中国银行长城环球通信用卡金卡额度建行信用卡二卡额度平安车主信用卡加油88折中国银行长城环球通信用卡金卡额度邮政信用卡还款日分期上海交购置税可以刷信用卡么县医院刷信用卡属于合理用卡吗?金穗吉祥航空联名信用卡信用卡还款日是17农行信用卡免年费政策办农村信用社信用卡手续信用卡中介能办出来吗?你好,我叫刘意。 如果能听到我的声音说明我距离你们并不遥远。 如果可以,请尽量避免外出,在家中备好食物与水请等待军队的救援,重申一下,如果可以请不要外出,外面很危险,到处都是食人的怪物,请拿好武器保护好自己,请一定要。。活下去。over郭卫穿越了,成为了一品大将军的儿子,但没想到开局就因为老爹造反被砍头。 但没想到他又竟然复活了,还陷入一个几乎必死了循环之中, 郭卫好不容易脱离循环,却发现自己还要收拾便宜老爹留下的烂摊子。 不得已郭卫造出许多了玩意,补贴家用。主角楚墨,婚礼时,被兄弟当场绿了,因气不过,直接冲出婚礼现场,可突然,一辆小车冲来,死了……非典型的轻玄幻武侠载体。素不相识的两人,共同走入面对血狱幽冥傀儡的故事中,历经九洲大地,看遍风起云涌,知天下疾苦,晓人间冷暖,从出西秦始,至返蜀中止,在神州大地划了个大圈,圈尽世间百态。真红之血的互相共融,相识,相助,相知,相爱,志向共同的江湖儿女,同行,同心,同德,同力,共同营造出了一个激荡写意的家国江湖。一日之间,我从受人敬仰的师兄变成了门派弃徒。 被师父冤枉后逐出师门?和我出生入死的结拜兄弟背叛了我?就连和我青梅竹马的小师妹也不愿意相信我? 君子周而不比,小人比而不周。且看剑道天才左不比如何从绝境中寻找希望,从不幸的泥潭中奋起,在只身一人的江湖中书写一个属于君子剑的不朽传奇!这世界需要人站出来时我便会伫立于此于尔等共行生命本就脆弱,可以像尘土一样被一口气吹的烟消云散,但也可以活得无比顽强,像钢铁一般柔韧坚强。选择什么样的活法决定了人过什么样的生活,是像尘土一样毫无分量还是像钢铁一样成为国之柱石。在这个世界里,身存环境艰难,身边的亲朋好友随时都会被夺走性命,只有最坚韧的人才能活到最后。然而最终,我们都将从尘土里来,再回到尘土里去。弓与箭的世界,唯箭技独尊,一个箭道奇才,巧得箭仙之弓,夺天下之造化,筑无上尊名,从此踏上了通神之路。 我常常幻想,是那么的真实,那么让自己相信。一切的一切都是假的。醒来没有任何改变,努力?奋斗?一样都不缺,缺的会是什么?烟夹在指间,不吸时的烟,和吸进肺的烟,吐出来的烟有什么不一样吗?我看来都一样,只有不点燃的烟会不一样。冉宇莫名的被拉进一个叫末世生存游戏当中,看他在这个末日世界中谱写怎样的一段传奇。
宇宙之外之人类的自我救赎 诡道志异 后室 暗室:异度空间 大明:人在洪武,朝九晚五 梦断仙踪 穿越后无敌的奇葩幻想 开局我就不是人了?! 当都 武都伏妖录 乾坤修法录 请,停止进化 来自东方的21世纪神 太古第一神王 妖孽小村医 怖城 地球升维 开向绿野春风 荒漠幸存 天下第一公子 农行信用卡 短信激活 卡片默认凭签名消费 中行信用卡 粤通卡 超过65岁补发信用卡 中国银行长城环球通信用卡金卡额度 农行信用卡 短信激活 卡片默认凭签名消费 信用卡欠了20万怎么还 黑龙江建行信用卡去哪分期购本田车 中国银行信用卡长城金额度 金穗吉祥航空联名信用卡 信用卡中介能办出来吗? 邮政信用卡还款日分期 信用卡 购车 上海交购置税可以刷信用卡么 中行环球港澳台版信用卡额度多少 注销的中行信用卡可以补吗 县医院刷信用卡属于合理用卡吗? 黑龙江建行信用卡去哪分期购本田车 金穗吉祥航空联名信用卡 平安车主信用卡加油88折 信用卡不激活会影响信用吗 中行信用卡 粤通卡 长城金信用卡介绍 中国邮政储蓄银行信用卡账单日 东莞农商银行 信用卡 中行环球港澳台版信用卡额度多少 上海交购置税可以刷信用卡么 金穗吉祥航空联名信用卡 中国邮政储蓄银行信用卡账单日 平安车主信用卡加油88折 金穗吉祥航空联名信用卡 县医院刷信用卡属于合理用卡吗? 中行信用卡 粤通卡 信用卡还款日是17 信用卡不激活会影响信用吗 农行信用卡免年费政策 县医院刷信用卡属于合理用卡吗? 中国银行信用卡还款说明 黑龙江建行信用卡去哪分期购本田车 上海交购置税可以刷信用卡么 中国银行信用卡还款说明 县医院刷信用卡属于合理用卡吗? 信用卡卡住老年人 建行信用卡二卡额度 信用卡 购车 东莞农商银行 信用卡 中行信用卡 粤通卡 邮政信用卡还款日分期 信用卡还款日是17 办农村信用社信用卡手续 18岁没工作能办信用卡吗 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 最强武神路 繁局 元宇宙:青铜 我竟然是女帝老婆的心魔 踩马童的二三事连载 百度 百度 百度 百度 百度 中国银行信用卡长城金额度 金穗吉祥航空联名信用卡 信用卡卡住老年人 18岁没工作能办信用卡吗 农行信用卡 短信激活 卡片默认凭签名消费 金穗吉祥航空联名信用卡 信用卡中介能办出来吗? 农行信用卡免年费政策 信用卡中介能办出来吗? 东莞农商银行 信用卡 长城环球通信用卡前5年免年费 办农村信用社信用卡手续 黑龙江建行信用卡去哪分期购本田车 建行信用卡二卡额度 东莞农商银行 信用卡 信用卡不激活会影响信用吗 建行信用卡二卡额度 信用卡卡住老年人 注销的中行信用卡可以补吗 中国银行信用卡还款说明 中国银行信用卡长城金额度 信用卡还款日是17 信用卡不激活会影响信用吗 中国银行长城环球通信用卡金卡额度 农行信用卡 短信激活 卡片默认凭签名消费 信用卡 购车 金穗吉祥航空联名信用卡 中行信用卡 粤通卡 县医院刷信用卡属于合理用卡吗? 中行信用卡 粤通卡 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网