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
河北泊头市解放街道圆通电话河北省沽源县百世快递电话河北泊头市申通营业厅电话合肥瑶海汇通快递电话河北沧州泊头中通快递电话是多少河北泊头市解放街道圆通电话河北河间快递电话河北泊头市申通营业厅电话河北曲阳邮政局电话河北沧州申通快递客服电话河北省沧州河间瀛洲镇圆通电话河北泊头市申通营业厅电话河北沧州市盐城县顺丰快递电话号码河北省沧州河间瀛洲镇圆通电话合肥瑶海工业园中通快递电话河北沧州申通快递客服电话河北交河 百世快运 电话河北沧州东光圆通客服电话河北沧州泊头中通快递电话是多少河北泊头快捷快递电话河北曲阳邮政局电话是多少河北沧州东光圆通客服电话河北曲阳邮政局电话和县西埠邮政局电话合肥瑶海区中通快递员电话河北省黄骅市中捷农场邮政电话合肥瑶海区中通快递员电话和平县百世快递网点电话河北泊头快捷快递电话河北赤城中通快递联系电话“我是谁?我从哪来?我要到哪去?”这亘古不变的问题困扰着少年,他望着海面脑海里一片空白,他失去全部的记忆只留下一具空白的身体,我之前是个什么样的人,是一个冒险家?是一个魔法师?是一个厨师?是一个建筑师?是一个酿酒师?是一个农民?是一个工人?是一个商人?是人人称赞的好人?是坏事做尽的恶人?是平平无奇的市民?无数的疑惑压在少年的心上,幽幽中一个声音传来,“去篱下院吧,那里有你需要的答案。”于是少年踏上寻找自我的旅程,在路上他会遇到什么样的冒险呢?又会遇上什么样的人?一名学生,经历商业洗礼 一个传奇,历练终成奇迹 到底如何,且看商业风云随着光芒的闪动,袁东升莫名其妙的参加了一场诸神举办的战争游戏。 在这宏大的虚空之中,每位玩家都会获得一块属于自己的领地地块,而随着地块面积的增加,玩家的领地终会在虚空中链接。 而胜利的唯一标准,或者说活下去的唯一机会,就是消灭所有的玩家。那么战斗吧,消灭无数的竞争对手,只为活下去!箴言:你在左,我在右,莫回头,煮酒把歌...少年风行逐月夜,青春无载盼悠悠,红尘情剑断如苟,苍渺仙路难觅觅,彼岸花开三杀变,匡匡渠穹夭夭仙!鲲宇虚纳动九天,龙游伏洞藏九地!宙杀时势,天谕机变,苍穹点极,斗转星移!战仙歌,青锋白落谁主星瀚沉浮.....? 南宫凯风一生中最傲睨得志的不是他拯救了全封澜大陆的人,而是他从两个最强者的斗争中活了下来。 封澜大陆有炼器的儒家,炼丹的道家,练结界的佛家,修武的凡夫。南宫凯风从剧痛中醒来,发现自己被人刺了一剑,还被人诬陷,三日后找不到凶手就要偿命……他本想摆烂重开,但忽然发现一切好像没有那么简单…… 多年后,当他看着身后逝去的敌人和朋友所堆成的累累白骨,还有妻子的坟墓时,想起了一句话,人生有两出悲剧,一个叫踌躇满志,一个叫万念俱灰。 大道唯我,无论道佛,一心为本,自在由我。 36位仙帝掌控仙域,瓜分世界果实强大己身,仙帝非圣贤,欲突破桎梏探索域外,仙域大乱,仙帝陨落。 且看叶林在机缘巧合之下获得魔尊残魂相助,最终踏上一段奇幻、动人心魄、荡气回肠的寻仙之路。 管你是神是佛,如不臣服,诸神灭佛。  “奉天承运,皇帝诏曰!北渊王苏长歌私通贼党,意欲谋反,其罪当诛!即日起废除北渊王身份,打入北云宫面壁思过,终生不得离开!钦此——”   苏长歌穿越而来,成为因帝王猜忌而打入冷宫的废王爷,幸好绑定了【绝世剑仙系统】,拔剑就变强!   拔剑1次,奖励【神级剑心】【神级剑胎】【神级剑道】!   拔剑1000次,奖励【神级灵剑】【神级剑诀】!   累计拔剑一年,触发特殊奖励【天人合一境】!   不仅如此,系统告知三百年后灵气复苏,低武世界将一夜转为修仙盛世!   三百年后,世间沧海桑田,无数天之骄子大放异彩。   苏长歌怀着激动忐忑的心情走出冷宫,却发现世人眼中的神在他面前如蝼蚁一般弱小!   那一日,苏长歌身周万剑环绕,剑气席卷百万里,一剑破开天门,剑指天上仙。   “天上剑仙三千万,见我也需尽低眉!”牛天是一个孤儿,自幼被父母抛弃,由于误吃了千年灵芝和毒蟒的血,使自己意外的变成了一个拥有神奇能力的人,他开矿厂开荒种药材,建养殖区,一夜之间暴富,带领全村人走上致富之路,且看一个无名小子,如何从一个小农民逆转命运,叱咤都市。一名学生,经历商业洗礼 一个传奇,历练终成奇迹 到底如何,且看商业风云世界异变,规则崩坏,意外觉醒强大星魂的李飞,将何去何从。
文学杂记 诡道天师 特种兵之最强国术系统 重生之开局伪装成大佬 越空行者 十八那年那碗面 绝地求生之全职高手 侠骨柔情千魂刀 凡人轶事录 猿王 社团指导老师 为故乡星球而战 葬剑祈 绮梦仙游 绝品医王 我有一个修真互联网 墨默行长夜 风入松歌 武神魔心 末日基因兑换系统 河北省河间市开发区顺丰电话 河北省沧州市青县百世快递电话号码 河北泊头圆通快递电话 河北沧州泊头中通快递电话是多少 河北省沽源县百世快递电话 和平县百世快递网点电话 河北泊头圆通快递电话 河北沧州市盐城县顺丰快递电话 河北省黄骅市中捷农场邮政电话 河北沧州市盐城县顺丰快递电话号码 河北廊坊邮局电话多少 河北廊坊邮局电话多少 河北保定曲阳县的邮局电话 河北省沧州市青县百世快递电话号码 河北泊头市解放街道圆通电话 河北沧州泊头中通快递电话是多少 河北廊坊三河邮政投诉电话 河北省河间市开发区顺丰电话 河北省赤城县中通电话 河北泊头市申通营业厅电话 河北省沧州市青县百世快递电话号码 河北泊头市申通营业厅电话 河北省赤城县中通电话 河北沧州东光圆通客服电话 河北沧州申通快递客服电话 河北保定曲阳县的邮局电话 河北省河间市开发区顺丰电话 河北省赤城县中通电话 河北省赤城县中通电话 河北省黄骅市中捷农场邮政电话 河北沧州泊头中通快递电话是多少 河北省沧州市青县百世快递电话 合肥瑶海汇通快递电话 河北泊头市解放街道圆通电话 和县西埠邮政局电话 合肥瑶海区中通快递员电话 合肥瑶海汇通快递电话 河北泊头圆通快递电话 和县西埠邮政局电话 合肥瑶海工业园中通快递电话 合肥瑶海区中通快递员电话 河北沧州市盐城县顺丰快递电话 河北泊头快捷快递电话 河北廊坊三河邮政投诉电话 河北省沧州河间瀛洲镇圆通电话 河北省沧州市青县百世快递电话 河北廊坊邮局电话多少 合肥瑶海区中通快递员电话 河北保定曲阳县的邮局电话 河北交河 百世快运 电话 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 天革 守护者与猫头鹰 和校花妹妹同居的日子 掌中神佛 世间繁华犹如走马观花 百度 百度 百度 百度 百度 河北省沧州河间瀛洲镇圆通电话 河北省沧州河间瀛洲镇圆通电话 合肥瑶海工业园中通快递电话 合肥瑶海汇通快递电话 河北泊头快捷快递电话 河北泊头市解放街道圆通电话 和县西埠邮政局电话 河北沧州东光圆通客服电话 河北沧州市盐城县顺丰快递电话 河北省沽源县百世快递电话 河北泊头快捷快递电话 河北廊坊三河邮政投诉电话 河北省黄骅市中捷农场邮政电话 河北河间快递电话 河北泊头市解放街道圆通电话 河北省赤城县中通电话 河北省沧州河间瀛洲镇圆通电话 河北省沧州河间瀛洲镇圆通电话 河北省河间市开发区顺丰电话 河北省黄骅市中捷农场邮政电话 河北曲阳邮政局电话是多少 河北泊头快捷快递电话是多少 和平县百世快递网点电话 河北沧州泊头中通快递电话是多少 合肥瑶海工业园中通快递电话 河北省赤城县中通电话 河北保定曲阳县的邮局电话 河北省沧州市青县百世快递电话号码 河北泊头市申通营业厅电话 河北河间快递电话 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网