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
狗狗剪指甲不配合狗狗感冒了打什么针狗狗叫了几声后躲起来狗狗可以活到多少岁狗狗可以闻厕所狗狗剪毛什么时候合适狗狗被车撞死代表什么狗狗叫了几声后躲起来狗狗厕所怎么洗狗狗老去厕所舔狗狗拉血颜色很红狗狗剪指甲不配合狗狗皮肤病黑色斑点狗狗空咬嚼狗狗叫了几声后躲起来狗狗老去厕所舔狗狗白色米粒虫图片狗狗可以在雪地里跑吗狗狗可以在雪地里跑吗狗狗假孕要假孕多久啊狗狗感冒初期症状狗狗可以在雪地里跑吗狗狗厕所怎么洗狗狗肌肉注射位置图片狗狗可以闻厕所狗狗喝了粪汤狗狗可以活到多少岁狗狗很好但细小弱阳性狗狗假孕该怎么处理狗狗皮肤病黑色斑点兽神紫林转世到地球成为了罗煌;一个强者的故事。一部奋斗史,两代传奇人。某军区老虎连侦察班在南越战场上建立不休功勋和传奇,但却伤亡惨重。新时代,侦察班的后人们历经坎坷,茁壮成长,继往开来,在新的战场上再写传奇。克里斯托与未婚妻艾薇儿出席宴席期间发生的故事…一场精心策划多年的入侵,摧毁了夏月一族最后的净土,为了复仇,也为了让族人活下去,夏月提前肩负起自己的责任。 没想到数年之后,夏月姐妹二人却发现了世界的秘密,在这个不断轮回的世界里,她们是唯一的变数。 我们,只想活下去!“快来救我,我被困在相亲对象家的棺材里了!” 接到这个电话的吴邪和谢小花一脸懵逼。 现在小年轻都玩的这么花? 棺材? 还把自己困进去了? 而当他们根据地址赶来之后,却险些丧命于这看似普通的店铺当中! 最后找到了霍秀秀,却也没办法将其解救。 即便是暗中保护的小哥和吴三省也手足无措。 反而是差点被守护的扎纸人给一刀两断! 在这危急万分的时刻,阴风四起,一顶纸人抬轿停在了门口...... 多年以后。 霍秀秀注视着陌上少年:“扎纸匠、赶尸人、阴阳先生.....顾言,你到底还有多少身份啊?” 顾言腼腆的笑了笑,“方方面面都懂亿点吧!”  万族入侵,人族求存!   这是一个可修超凡的世界,万族皆从圣墟之中熔炼元魂成为修灵者。   顾北辰携带圣图来到此方世界,一步一个脚印登顶人族至尊,威压诸天万界……   凤凰山的幸福生活! 世纪之末, 仙路湮灭,前路断绝,动乱时代,宇宙重开,少年叶天重生于异域,从此踏上仙武大道,悟五行,领阴阳,掌握极致力量。堤岸横空,生灵争渡,不详与诡异肆虐。 少年的背后是血与乱,是生灵的悲歌,少年的探寻的是万灵之希望。彳亍前行,万古寂然,永远在路上。灵气入体,滋养四肢百骸;魔晶融合,震动百里山河。 心念一动,可风起云涌;振臂一呼,可天翻地覆。敢叫沧海变桑田,敢叫日月换新天。 茫茫的“东华大陆”是修真者的世界,但是,修真者的数量却少之又少,大陆上生活着的主要还是普通人。除了人类,大陆上一直没有还能修行的生物,直到那件事情的发生……王侯将相,宁有种乎? 泱泱大晋,达官显赫,人才无数。 但我罗明秋亦能以蝼蚁出身,搅动风云。 文官之首:“燕雀安知鸿鹄之志哉?吾亦不知罗明秋!” 镇国将军:“这一扎子读书人中,某最服的就是罗侯爷。” 真龙:“这龙椅,明秋君比我更合适!” 皇后:“与君相见恨晚,若不然,这后宫之主不当也罢……” 且看一介书生,如何拨弄这天下棋盘……
为所欲为之重选人生 梦世界幻想曲 末日跑跑 罪启 一剑求尊 大小姐的末世保镖 齐天云帝 十二生肖战纪 大秦:朕都皇帝了,你让我造反? 恶紫夺朱 灵异:我与我的废物系统 北冥傲天诀 魂斗灵罗 大明:开局被弃,永乐求我称帝 生命裁决者 破晓之轮回 下班,然后捡到雷电将军 末世之尸王 励志事务所的创办记 神奇宝贝之开局黑化沙奈朵 狗狗冠状怎么算治好了 狗狗老跑厕所怎么办 狗狗白色米粒虫图片 狗狗可以在雪地里跑吗 狗狗冠状怎么算治好了 狗狗喝药呛到了一直卡 狗狗安葬在哪里合适 狗狗流涎咬牙怎么办 狗狗喝了粪汤 狗狗皮肤病黑色斑点 狗狗厕所怎么洗 狗狗y开头英文名 狗狗肌肉注射位置图片 狗狗老去厕所舔 狗狗剪毛什么时候合适 狗狗可以闻厕所 狗狗安葬在哪里合适 狗狗喝了粪汤 狗狗感冒初期症状 狗狗剪指甲不配合 狗狗老跑厕所怎么办 狗狗叫了几声后躲起来 狗狗感冒了打什么针 狗狗空咬嚼 狗狗老去厕所舔 狗狗肌肉注射位置图片 狗狗喝了粪汤 狗狗感冒了打什么针 狗狗感冒初期症状 狗狗喝了粪汤 狗狗可以闻厕所 狗狗老跑厕所怎么办 狗狗可以吃人吃的维生素b吗 狗狗剪指甲不配合 狗狗很好但细小弱阳性 狗狗可以闻厕所 狗狗可以吃人吃的维生素b吗 狗狗安葬在哪里合适 狗狗肌肉注射位置图片 狗狗可以吃人吃的维生素b吗 狗狗可以闻厕所 狗狗配种多久能看出来 狗狗假孕要假孕多久啊 狗狗y开头英文名 狗狗空咬嚼 狗狗老跑厕所怎么办 狗狗厕所怎么洗 狗狗可以活到多少岁 狗狗假孕该怎么处理 狗狗被车撞死代表什么 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 玉过添琴 无量仙宫 哈利波特之金狮传说 活死人围城 妖孽小村医 亚星管理平台 万利游戏官网 万利官网 亚星管理平台 澳门葡京官网 狗狗安葬在哪里合适 狗狗被车撞死代表什么 狗狗假孕要假孕多久啊 狗狗安葬在哪里合适 狗狗该打什么疫苗 狗狗肌肉注射位置图片 狗狗该打什么疫苗 狗狗y开头英文名 狗狗感冒了打什么针 狗狗老跑厕所怎么办 狗狗可以活到多少岁 狗狗流涎咬牙怎么办 狗狗喝药呛到了一直卡 狗狗感冒了打什么针 狗狗喝药呛到了一直卡 狗狗可以活到多少岁 狗狗假孕该怎么处理 狗狗很好但细小弱阳性 狗狗安葬在哪里合适 狗狗肌肉注射位置图片 狗狗剪毛什么时候合适 狗狗拉血颜色很红 狗狗剪指甲不配合 狗狗假孕该怎么处理 狗狗可以吃人吃的维生素b吗 狗狗该打什么疫苗 狗狗感冒了打什么针 狗狗感冒初期症状 狗狗可以闻厕所 狗狗叫了几声后躲起来