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
办信用卡得行李箱好吗办理信用卡总是过不去办信用卡得行李箱好吗办信用卡发帐号给别钱办信用卡接到征信电话了帮信用卡养卡违法必胜客活动信用卡2016办信用卡的属于什么银行办理信用卡那个银行好办信用卡时说错信息办信用卡审查什么材料办信用卡得行李箱好吗办信用卡需要收费么办信用卡拿了公章盖章就违法了?办信用卡的属于什么银行办信用卡时说错信息办理信用卡的年龄办信用卡流水视频办信用卡流水视频办信用卡父亲的车我开着怎么办办理信用卡要查夫妻双方征信吗办信用卡流水视频办理信用卡那个银行好百分百下卡的信用卡办信用卡接到征信电话了办浦发信用卡手续费办信用卡发帐号给别钱百分百下卡的信用卡办信用卡父亲的车我开着怎么办办信用卡需要收费么古老的宇宙外,五尊身影凝视着,五种不祥之力充斥天穹,一个祭坛在无人脚下,若隐若现……华夏战神龙啸天领狼牙特战军,保国卫民,血染沙场,成就不世功勋。为了给儿时兄弟报仇,从边境战区回归家乡夏城,在调查中,发现好兄弟的死因竞牵扯了一个惊天秘密。为了保护家人,为了守护心爱的女人,从而引发一序列爱恨情仇,荡气回肠的动人故事。几个月前的一桩杀人案,意外地将主人公恩德尔卷入了一场危机,他要寻找的,不仅仅是丢失在空荡房间的证据,更是牵扯他命运的幕后操纵者,在重重的背叛与不信之中,他能否看清,谁是消失的罪人......林啸意外穿越特种兵的世界,随身带着最强国术系统。 每提升一个等级,不但身体会得到强化,还能获得新的国术,成为自己的天赋神通,既分高低,也定生死。 暗器精通:拥有此技能,你可以熟知每一件事物的属性,能将任何一种物品当作杀人的利器,杀人是一种技术,不滞于物,请谨慎使用此技能。 何晨光:“你从娘胎就可以练功吗?” 雷战:“牙签也能杀人,老子服了!” 安然:“啸哥,你确定你的女友是大明星?不是特种兵?” 范天雷:“狼牙的未来就交给你了,老子提前退休。你见过已死之人诈尸吗?你见过被人类所救千年报恩的狐妖吗?你见过生命无尽跳出六道轮回的僵尸吗?是否又见过跨越生死的人鬼恋情呢?主角林沐从小习得神秘道法在都市之中纵横游历降妖伏魔,但却陷入一个又一个的巨大邪教阴谋之中......(女帝、单女主、撩粮、爽文) 你被女人套路过么? 林羽深有体会,只因系统拜师一位女帝,本以为抱上大腿,从此无忧无虑; 可谁能想到,某天他被带到一场婚礼上无数大能对他贺道:“恭喜公子迎娶女帝,祝二位百年好合,早生贵子!” 女帝:羽儿.哦不,夫君,你今日必须娶我! “你赠送师父淬体精华,返还深骨养液!” “你赠送师父冰寒之剑,返还诛魔剑!” “你赠送自己,返还一个女儿!” 一直靠【万倍返还】薅羊毛的林羽,争取做世间最强者,可没想到,薅着薅着,竟把自己也给送出去了。 女帝娇羞道:夫君,目之所及,皆是为师替你打的天下! 这是一个普普通通的穿越故事,然而穿越了也不一定是主角,就比如夏子羽同学。“小姐姐,有事说话,别动手。”“小姐姐,先把剑放下。”“小姐姐,你又捡到宝物了吗?”……夏子羽陷入了沉思,“所以,谁才是主角?”天界至宝天神之怒碎裂成两半,从此消失不见,天界由此陷入混乱。要想天界恢复秩序,必须寻回天神之怒。在天界遍寻无果之下,众天神不由束手无策。 废柴?退婚?绑定作死系统?作死就能变强? 叶天尘:想当年作死的过程多么快乐,可是一晃眼…… 轰隆隆!(仙帝法决袭来) 叶天尘:还是那么快乐! 只要杀不死我,我就能变强天道陨落,生命祭献,少年轮回,叙写传奇。且看,无双天骄,翻手天初,覆手天末,天临世间!
缘聚缘散缘起缘灭皆为天意 剑入仙道 龙之谷英雄 天师府小道士 末日靳区 三国:大军师之龙腾虎跃 圣幻灵域 火影之开局获得侠岚卦印 护妻战帅 王之都市文 我有一扇任意门 截天修真记 重启飞升之路 百花大帝 灵灯师 庆南吏 玩牌的我谁也打不过 守护大夏:从奥丁开始斩神 圣灵之魄 善良的剑神 办了房贷还能办信用卡 包装流水办信用卡 办理信用卡的年龄 办信用卡流水视频 办了房贷还能办信用卡 办浦发银行信用卡要买产品 办理信用卡的图片 办信用卡为什么送礼物 办浦发信用卡手续费 办信用卡需要收费么 办理信用卡那个银行好 办理信用卡多少年龄 办信用卡 总金额100万 包装流水办信用卡 帮信用卡养卡违法 办信用卡接到征信电话了 办理信用卡的图片 办浦发信用卡手续费 办理信用卡要查夫妻双方征信吗 办信用卡得行李箱好吗 包装流水办信用卡 办信用卡的属于什么银行 办理信用卡总是过不去 办信用卡拿了公章盖章就违法了? 办信用卡时说错信息 办信用卡 总金额100万 办浦发信用卡手续费 办理信用卡总是过不去 办理信用卡要查夫妻双方征信吗 办浦发信用卡手续费 办信用卡接到征信电话了 包装流水办信用卡 办信用卡都要哪些证明 办信用卡得行李箱好吗 百分百下卡的信用卡 办信用卡接到征信电话了 办信用卡都要哪些证明 办理信用卡的年龄 办信用卡 总金额100万 办信用卡的属于什么银行 办信用卡发帐号给别钱 办信用卡先存钱吗 帮人套现信用卡有风险吗 办理信用卡多少年龄 办信用卡拿了公章盖章就违法了? 包装流水办信用卡 办理信用卡多少年龄 办信用卡发帐号给别钱 办信用卡父亲的车我开着怎么办 必胜客活动信用卡2016 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 龙之谷英雄 万域剑帝 命里成仙 空弹一出戏 一剑独仙 亚星管理平台 亚星官网 万利官网 亚星管理平台 澳门葡京官网 帮信用卡养卡违法 百分百下卡的信用卡 办信用卡接到征信电话了 办信用卡得行李箱好吗 办信用卡为什么送礼物 办信用卡审查什么材料 办信用卡 总金额100万 办信用卡都要哪些证明 必胜客活动信用卡2016 帮人套现信用卡有风险吗 办信用卡先存钱吗 办信用卡 总金额100万 百分百下卡的信用卡 办信用卡先存钱吗 办信用卡发帐号给别钱 帮人套现信用卡有风险吗 帮人套现信用卡有风险吗 办浦发银行信用卡要买产品 百分百下卡的信用卡 帮信用卡养卡违法 办信用卡都要哪些证明 办信用卡审查什么材料 办理信用卡那个银行好 办浦发信用卡手续费 必胜客 周六 信用卡 办理信用卡年龄有限制吗 办信用卡为什么送礼物 百分百下卡的信用卡 办理信用卡的图片 办信用卡都要哪些证明