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
狗狗细小后怎么调理狗狗细小第三天的症状狗狗细小恢复期拉黑便狗狗细小恢复症状表现狗狗细小假死的症状狗狗细小后怎么调理狗狗细小休克是晚期吗狗狗细小恢复期拉黑便狗狗细小自己吃东西狗狗细小七天症状描述狗狗细小拉绿色的便便狗狗细小后怎么调理狗狗细小疼的一直叫狗狗细小拉绿色的便便狗狗细小恢复期拉黑便狗狗细小拉青色便便狗狗细小一直惨叫狗狗细小假死的症状狗狗细小假死的症状狗狗细小后5天没拉屎狗狗细小不治几天死亡狗狗细小康复便便图片狗狗细小自己吃东西狗狗细小好转后 流鼻涕狗狗细小几天拉血狗狗细小粪便中期图片狗狗细小恢复症状表现狗狗细小好了可以吃稀饭吗?狗狗细小后5天没拉屎狗狗细小休克好点了一个人的成长故事人死为鬼,道成为仙,纯阴而无阳者,鬼也! 纯阳而无阴者,仙也,唯人可以为鬼,可以为仙!故自古以来,修行之道分为两种 人仙之道,修炼肉身,打熬气血,冲开穴窍! 鬼仙之道,修炼元神,观想天地,雷劫筑 神 冥冥之中自有天意,穿越者何必天下无敌。人心正,自有天助。召唤师,万兽朝宗…… 战士等级:初级、中级、高级、青铜、黄铜、黑铁、白银、黄金、圣战士 法师等级:学徒、一级——六级、七级大魔法师、八级魔导师、九级圣魔导师 召唤兽法师:无等级区分 意外穿越大秦,成为八公子嬴子夜,觉醒神级阅读系统,只要读书就变强!只要读书就能获得无限奖励,只要读书便可入圣! 为此,嬴子夜终日闭关读书,兢兢业业,不招灾,不惹祸。 终有一日! 始皇重危,意欲东巡求长生。 墨家蠢蠢欲动。 六国余孽准备造反。 赵高意欲篡改遗诏。 …… 嬴子夜知道,这时候不能继续藏了!再藏大秦不复、自己也将被胡亥杀死! “扮猪吃虎十余年,今日本公子不藏了!” “今日,本公子以读书入圣!一剑斩天!” “传令,三千大雪龙骑军出动!” “传令,铁浮屠出动!” “……” 世界末日,是真的结束?还是新的开始?人类进化,天赋崛起,活下去,比什么都重要。一个在两年前很多人都以为死了的特种兵,悄然回到自己的故乡,本想着可以安心地陪着自己的母亲过平淡的生活,却不曾想一个偶遇让他再次回归曾经的世界…一千万人的一座城市,穿越到了牛鬼蛇神横行的隋末,开始脚踏实地的求生存、谋发展、救百姓、扩疆土、屠异族、霸蓝星。 大隋朝廷和现代人之间的冲突矛盾、各路起义军和直沽市直接的矛盾。 隋炀帝真的是昏君吗?末世降临,一场暴雨过后,地球上丧尸横行! 重生回来的宋严,意外获得了签到系统,从此一路高歌猛进! 当人们因为丧尸而畏首畏尾的时候,宋严一马当先地冲入丧尸群中! 当人们为了一把热武器抢破头的时候,宋严缴获了军火库! 当人们想要拥有避难所的时候,宋严攻下小镇发展起了根据地! 当人们愣神的时候,宋严已然成了传奇!徐影良是徐航企业的大少爷,生母许羽美被继母安达莎谋杀夺夫,徐航企业被迫置于安家门下。徐影良死里逃生,故意以徐商集团抢救徐航企业。不知情的继母让他娶同父异母的亲妹妹徐菲娜,让同父异母的亲弟弟徐宏安娶他的发小杨晴晴,想吃死徐商集团,一统国内外。徐影良以女婿名义荣归故里,徐宏安和杨晴晴无心联姻,而杨晴晴喜欢徐影良。 徐老夫妇因阻止不良亲家的无限野心被安达莎痛下杀手未遂,致使徐菲娜和徐宏安倒戈,查到许羽美的死亡真相,和亲大哥一起公正法办娘家。安达莎跟徐影良抢商星荣衔并吞没家业,安老夫妇畏罪病逝。安家罪行曝光后,两家依法强制结束关系,安达莎哭求亲生儿女惜命谅恕,子女无以谅解娘家恶贯满盈,收归至徐影良处,认许羽美当妈妈。徐影良娶杨晴晴衣锦还乡,兄弟俩不想误入歧途,徐航企业并入徐商集团,徐宏安则另谋高就从零做起,继承徐家的优良传统。安家产业被严法惩处,徐菲娜也解脱而修学深造。研究生毕业孙淼回家种田,他家的猫咪会 说话,乌龟会爬树,鹦鹉会唱歌,带你见识一个从小山村走向巅峰的人生。
赋闲贵人 斩彦 魔女图鉴 创世修心决 我在末日中横行 星际大航海:崛起 弃婿柴小明 万古鬼尊 我的道是最毒的 大神豪财富自由系统 夕阳下的拾荒者 美好的异世界生活之旅 四颗丸子的未知世界 我与中医之缘 异世的希望 万纹之秘 笑傲之富贵逍遥 时空赏金猎人 真实之幻 真神的能力和毁灭! 狗狗细小粪便中期图片 狗狗细小拉青色便便 狗狗细小治好的症状 狗狗细小假死的症状 狗狗细小第三天的症状 狗狗细小好了可以吃稀饭吗? 狗狗细小治好的症状 狗狗细小输液后的状态 狗狗细小好后不拉屎 狗狗细小疼的一直叫 狗狗细小转好的症状 狗狗细小转好的症状 狗狗细小好转后 流鼻涕 狗狗细小拉青色便便 狗狗细小后怎么调理 狗狗细小几天拉血 狗狗细小治好之后 狗狗细小粪便中期图片 狗狗细小初愈吃什么 狗狗细小恢复期拉黑便 狗狗细小拉墨绿色稀便 狗狗细小恢复期拉黑便 狗狗细小初愈吃什么 狗狗细小康复便便图片 狗狗细小七天症状描述 狗狗细小好转怎么调养 狗狗细小粪便中期图片 狗狗细小初愈吃什么 狗狗细小初愈吃什么 狗狗细小好后不拉屎 狗狗细小假死的症状 狗狗细小拉墨绿色稀便 狗狗细小恢复症状表现 狗狗细小后怎么调理 狗狗细小好转后 流鼻涕 狗狗细小几天拉血 狗狗细小恢复症状表现 狗狗细小治好的症状 狗狗细小好转后 流鼻涕 狗狗细小恢复期又吐了 狗狗细小几天拉血 狗狗细小输液后的状态 狗狗细小后5天没拉屎 狗狗细小治好之后 狗狗细小拉绿色的便便 狗狗细小拉墨绿色稀便 狗狗细小转好的症状 狗狗细小几天拉血 狗狗细小好转怎么调养 狗狗细小一直惨叫 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 我有9000万亿神豪基金 光辉的印记 太岁:不良少年到待业青年 我不是昏君 重生之古神噬天 万利游戏官网 欧博官网 皇冠登3出租 万利游戏官网 快连下载 狗狗细小假死的症状 狗狗细小七天症状描述 狗狗细小初愈吃什么 狗狗细小好转怎么调养 狗狗细小拉墨绿色稀便 狗狗细小粪便中期图片 狗狗细小休克好点了 狗狗细小后拉绿色便便 狗狗细小不治几天死亡 狗狗细小康复便便图片 狗狗细小康复便便图片 狗狗细小第三天的症状 狗狗细小粪便中期图片 狗狗细小自己吃东西 狗狗细小后5天没拉屎 狗狗细小好后不拉屎 狗狗细小几天拉血 狗狗细小恢复期拉黑便 狗狗细小疼的一直叫 狗狗细小好转后 流鼻涕 狗狗细小拉墨绿色稀便 狗狗细小休克是晚期吗 狗狗细小假死的症状 狗狗细小不治几天死亡 狗狗细小输液后的状态 狗狗细小假死的症状 狗狗细小好转怎么调养 狗狗细小第三天的症状 狗狗细小第三天的症状 狗狗细小转好的症状