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
宁波汽车东站到舟山如东到常熟汽车站时刻表长沙到茶陵坐汽车要多久贵阳 凯里 汽车江阴到苏州汽车时刻表宁波汽车东站到舟山昆山到庆阳汽车票长沙到茶陵坐汽车要多久南通市通州区汽车站嘉善到金华汽车西站南通到海宁汽车宁波汽车东站到舟山上海虹桥汽车站到南通南通到海宁汽车长沙到茶陵坐汽车要多久嘉善到金华汽车西站广州新塘汽车客运站到从化要多久上海到苏州长途汽车上海到苏州长途汽车保定火车站到徐水汽车常熟到无锡的汽车时刻表兰州到临夏汽车时刻表慈溪到常熟汽车金沙到南通长途汽车站江阴到苏州汽车时刻表中山富华总站到肇庆汽车总站贵阳 凯里 汽车南通到盱眙汽车奉化到三门汽车上海虹桥汽车站到南通命运多舛的少年,不谙世事的灵智,两者的结合在九州大陆掀起了阵阵腥风血雨。 在这里也许会看到华夏神话的延续,也许会看到超强的灵宝,也许会看到上古遗迹,也许会看到各种稀奇古怪的异兽,也许会看到魔之本相……伏羲献祭,生命之枯萎,生命之种种子散落各地,十二颗生命种子地方都成为了禁地,经历九万年生之种开始发芽了。 灭门惨案人族少年开起了复仇之路[纷扰如迷雾,逍遥且徐行] 入梦方醒,方觉大道维艰。从小世界意识回归醒来的大光头,抬手摸着自己脑瓜低吟着“无量天尊。” 看着身边传讯符,回忆着这次化身从婴儿到意气少年,又度过颠簸抗争的青年路程,往后便好似不记得自己有过壮年中年似的,回首时已在疑惑困顿中到了老年。 化身一生寂寥糊涂过,只留下一首连通顺都算不得的唯有悔恨的“一年一岁婴至此,一时一秒得与失。稻草压身抵千斤,默然回首如何持。神杂性善恶七情己,人和人白白入灰多。己识多实错分年,霎那蹉跎七十婴。” 又有那好似从老年到青年活着的感慨:“何所思何所愚何所怠,七十婴五十少三十明。天色长空人自老,道存事存时不存,上下空有物竞乾坤灭,事合人思万中无一寻。谁家孩儿拿那炮竹当烟花鸣一曲,潜游无欲无求后同求不在求呢。苦无一用怎是迷生。” 【女帝】、【脑洞】、【搞笑】 一位普通的网文读者云逸,穿越到了看似平常的异世界。 熟读套路的他,开局就抄了前世的一本经典仙侠小说,想要通过网文赚取第一桶金。 但没想到。 这个世界,正处于灵气复苏不久,修行之法还未开创的时代。 所以,当云逸小说火起来的同时,一部分人发现... 小说里的修行功法、锻器手段、炼丹丹方,竟真的全部可以模仿使用! 此刻,全球震惊,各国开始紧急接触云逸! “仙帝无私奉献,哪怕是圣品功法也未曾藏私,令人钦佩!”有人族修士恭敬道。 “师父悉心教导,润物细无声,让我受益匪浅。”女帝徒弟言笑晏晏。 “仙帝一剑斩妖,救人族于水火,此等胸怀,我难以企及!”有人族大能跪拜。 自此,云逸被全球的修行者们尊为“开天地新生,创万界新道”的原初仙帝。一个人,一只妖,一本书,一段诡秘旅程,一段传奇故事。 天地玄黄,卧龙山冈,此一生,不见沙海渺茫 九州巨变,白露为霜,愿有一日,我顶他这朝霞,脚踩这般日落, “我要让这天,再也遮不住我眼” “荒古苍天名凡尘,脚踏日月我为尊”楚歌在一次晋级赛中,意外穿越到了王者大陆,无意间卷入到了这个世界的纷争之中,在这个王者世界,身具系统妹妹,不,姐姐的他,终向苍天怒喊,神又怎样,人又如何,人终究能够弑神!“对不起,我已无法再相信任何人了,所以请不要接近我。” 在目睹了最爱的青梅竹马接受别人的告白后,万念俱灰的诺尔斯选择默默离开了队伍。在遥远的地方想要重新开始却又遭到了新队友的背叛。心灵遭受重创的诺尔斯无法再相信他人,不断拒绝着周围的好意。 决心独自一人继续走上冒险者之路,就算只是一个普通的剑士,没有能力,不被期盼,只因这是和在心中死去的那个最爱的她所共同许下的愿望。 独狼男主的冒险之路是否会发生变化,平凡剑士是否能完成超越,请收看这本关于后悔与救赎交织的平凡剑士物语。 顶级科学家李谦因身患癌症,在临终前选择冷冻自己,以待未来攻克癌症后再治疗自己。 但没想到,一觉醒来之后,时间居然已经过了三万年。更让他绝望的是,此时的医疗不但没有更先进,反而因为三次核战争倒退到了十九世纪初期,癌症依然无药可医。 看着充满了赛博朋克的未来世界,李谦只能玩起文明模拟的元宇宙游戏,以期待通过模拟文明演变来解开人类基因的秘密,以治好自己的癌症。 然而万万没想到,这个世界居然只是一场为了奴役全人类的骗局…… 苏阳遭女朋友背叛,意外融合九阳医神传承,从此医术无双,武功盖世,财源滚滚,各色美女红颜纷至沓来。
异界修仙之无上帝尊 假装破产后,老婆跟别人跑了 无色神帝 大道凡音 道爷请留步 末代变异的世界 战斗兵神 我在用社死拯救世界 木牌传说 闲情自传 剑战诸天 十雄传 人道道人 网游之不朽风华 三生石前世 我爷爷是赵甲第 草根的江山如画 竹女传奇 随便成为什么 丰宁159师 青岛汽车北站到莱芜 嘉善到镇江汽车 广州新塘汽车客运站到从化要多久 上海到苏州长途汽车 青岛汽车北站到莱芜 南通到桐乡的汽车站时刻表 广德到嘉兴的汽车时刻表 单县到青岛的汽车电话 中山富华总站到肇庆汽车总站 上海虹桥汽车站到南通 慈溪到常熟汽车 慈溪到常熟汽车 金沙到南通长途汽车站 嘉善到金华汽车西站 桐城到黄梅的汽车去哪里坐 江阴到苏州汽车时刻表 广德到嘉兴的汽车时刻表 中山富华总站到肇庆汽车总站 常熟到无锡的汽车时刻表 宁波汽车东站到舟山 嘉善到镇江汽车 长沙到茶陵坐汽车要多久 如东到常熟汽车站时刻表 兰州到临夏汽车时刻表 单县到青岛的汽车电话 金沙到南通长途汽车站 中山富华总站到肇庆汽车总站 如东到常熟汽车站时刻表 常熟到无锡的汽车时刻表 中山富华总站到肇庆汽车总站 上海到苏州长途汽车 嘉善到镇江汽车 贵阳 凯里 汽车 宁波汽车东站到舟山 金沙到南通长途汽车站 江阴到苏州汽车时刻表 常熟到盐城汽车 广德到嘉兴的汽车时刻表 金沙到南通长途汽车站 常熟到盐城汽车 江阴到苏州汽车时刻表 杭州汽车西站公交 保定火车站到徐水汽车 通州长途汽车 兰州到临夏汽车时刻表 嘉善到镇江汽车 慈溪到常熟汽车 贵阳 凯里 汽车 奉化到三门汽车 昆山到庆阳汽车票 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 一百年后的人生 以无为名 海贼世界死过两次 我靠吟诗成儒圣 诸天圆梦行 澳门葡京游戏官网 葡京官网 快连下载 澳门葡京游戏官网 欧博游戏官网 金沙到南通长途汽车站 奉化到三门汽车 南通到桐乡的汽车站时刻表 江阴到苏州汽车时刻表 嘉善到金华汽车西站 常熟到无锡的汽车时刻表 金沙到南通长途汽车站 广州新塘汽车客运站到从化要多久 青岛汽车北站到莱芜 上海虹桥汽车站到南通 奉化到三门汽车 南通市通州区汽车站 上海到苏州长途汽车 江阴到苏州汽车时刻表 如东到常熟汽车站时刻表 青岛汽车北站到莱芜 通州长途汽车 奉化到三门汽车 中山富华总站到肇庆汽车总站 贵阳 凯里 汽车 宁波汽车东站到舟山 南通市通州区汽车站 南通到盱眙汽车 兰州到临夏汽车时刻表 如东到常熟汽车站时刻表 贵阳 凯里 汽车 南通市通州区汽车站 慈溪到常熟汽车 江阴到苏州汽车时刻表 金沙到南通长途汽车站