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
胶州申通快递总部电话是多少胶州申通快递总部电话胶州申通快递总部电话是多少钱江阴市长山邮政局电话江阴市区顺丰电话号码胶州申通快递总部电话是多少江西萍乡邮政快递电话胶州申通快递总部电话是多少钱江西新余泉塘申通快递电话焦作顺丰快递公司电话号码查询焦作山阳区顺丰电话胶州申通快递总部电话是多少钱揭阳普宁顺丰电话焦作山阳区顺丰电话胶州圆通投诉电话焦作顺丰快递公司电话号码查询江西萍乡邮政快递电话查询焦作区号电话号码焦作区号电话号码角美物流电话号码是多少钱江西新余泉塘申通快递电话号码焦作区号电话号码江西新余泉塘申通快递电话角美物流电话江阴市区顺丰电话胶州申通快递总部电话号码是多少江阴市区顺丰电话角美物流电话角美物流电话号码是多少钱揭阳普宁顺丰电话封神大陆, 穿越从娘胎开始,可惜的是他父母离奇死亡,诡异的黑气笼罩他的童年,他要查出谁杀的父母,星月女神加护下获得了一个暗杀系统,他开始了他的复仇成神之旅......一觉醒来,陆离发现自己居然穿越了! 他穿越成了方块大陆的史蒂夫! 这个异世界拥有和Minecraft相同的规则。 依靠丰富的游戏知识,陆离在异世界混的风生水起,红石专家,建造鬼才,神级锻造师,神级炼药师…… 而当怪物大军来袭,人人自危之时。 陆离手持拔刀剑,冲进怪堆开始屠杀。 众人见状纷纷惊呼道:“史蒂夫无敌了!”因救人死亡的江文重生回高中时代,起初想在自己的青春大搞一场,成为众人瞩目的那个最靓的仔,当异世界的经历让他懂得了珍惜眼前人才是最重要的..............大武王朝,邪异降临,诡异杀人于无形。 江夜携带修改器穿越。 燃血功+一气功,破极【炎阳神功】。 牛魔大力拳+十三太保横练,破极牛魔大力拳.真意。【牛魔真身】 狂风刀+黑虎刀法,破极【霸刀诀】。 疾风掠影+御风步,破极【御风隐形】轻功。 生死看淡,不服就干,这是一个以蛮力,武道,横推一切的故事。一个男人的奋斗史,从青春到大叔的蜕变,所有的经历,所有的人和事,都在岁月的漂泊里渐渐沉淀,成长为独立思考的个体!世间的所有都是珍贵,体验过的才最真实。有你有我的影子,在岁月里渐行渐远!超元域的天空和大地都是漆黑一片,宛如一幅没有任何图像显示的电脑屏幕。这里永远都是夜晚,而大街上始终华丽耀眼,灿烂夺目,就像超脱了物理法则和金钱限制的拉斯维加斯049收容失败,682收容失败,173收容失败 李三光成为scp基金会唯一活着的监督者,却发现基金会早以什么都没剩下了。 安全位面陷入混乱,基金会收容失效,旧神复苏在即,李三光苦恼大量能源何处而来,如何重新收容的时候…… “叮,位面聊天邀请您加入……” 本书又名:《scp收容之主》 如果我手上没有剑,我就无法保护你,如果我手上一直握着剑,我就无法抱紧你灵界中突然出现了不寻常的危机,这让灵界第一人林钧不知如何解决,而灵界之外,无数强者纷纷越界,想踏平灵界。 林钧苦守无果,最终无奈之下,他做出大胆决定,剥离人性,只身前往灵界之外,寻找问题根源,而分离出的人性,将会修炼灵界之中最强神法,重回大陆之巅,寻找救世之法。荒元。。。有神仙、有蛮、妖、兽、魔、有幽冥恶鬼;有超脱凡俗的界域。建筑设计师张浩然意外穿越来到修真世界,却身处平凡小渔村......三月后就是修炼学宫招收弟子.....他起初的目的只是希望按照宇宙定律中的二、八比例生存下去,顺便希望有一天能重返地球,然而在这个谁的拳头大谁说了算了世界唯有拼命修炼......不停认识自身,了解规则,突破壁垒......岁月无声,回首漫漫长河,可否找回曾经的自己?有诗曰:昨夜西风凋碧树,独上高楼、望尽天涯路。欲寄彩笺兼尺素,山长水阔知何处......
原境端倪 从红楼开始的诸天聊天群 特工传奇之重明 子夜出租 无限大陆发展史 迪迦耀世 我是战神赘婿!你确定 举目苍茫 异世修仙之魔宗崛起 古国传说 神灵的影子 无限穿梭世界的我掌控一切 末日后的三两事 快穿止戈为武 神兵小将之天下归心 奈何穿越爱上我 孤岛惊魂365天 飞狼野游队 一剑长空 大道源 胶州申通快递总部电话号码 焦作顺丰快递公司电话号码 江西萍乡邮政快递电话查询 江阴市区顺丰电话号码 胶州申通快递总部电话号码 角美德邦物流电话号码 江西萍乡邮政快递电话查询 蛟河邮局快递电话 胶州申通快递总部电话号码是多少 揭阳成都顺丰快递电话 将乐邮政电话号码 将乐邮政电话号码 角美物流电话号码是多少 焦作顺丰快递公司电话号码 胶州申通快递总部电话是多少 江阴市区顺丰电话号码 江西萍乡邮政快递电话号码 胶州申通快递总部电话号码是多少 江西宜春公司电话 胶州申通快递总部电话是多少钱 焦作顺丰快递公司电话号码 胶州圆通投诉电话 胶州申通快递总部电话 焦作山阳区顺丰电话 焦作顺丰快递公司电话号码查询 角美物流电话号码是多少 胶州申通快递总部电话号码是多少 胶州申通快递总部电话 江西宜春公司电话 胶州申通快递总部电话号码是多少 江阴市区顺丰电话号码 焦作顺丰快递公司电话 江阴市长山邮政局电话 胶州申通快递总部电话是多少 角美物流电话 江阴市区顺丰电话号码 江阴市长山邮政局电话 江西萍乡邮政快递电话查询 角美物流电话号码是多少 胶州圆通投诉电话 江阴市区顺丰电话 揭阳成都顺丰快递电话 胶州申通快递总部电话号码是多少钱 江西萍乡邮政快递电话号码 焦作山阳区顺丰电话 焦作顺丰快递公司电话号码 将乐邮政电话号码 江阴市区顺丰电话 角美物流电话号码是多少 江西萍乡邮政快递电话 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 大道界墟 苍银骑士与魔女传说之夜 冰山美女的最强兵王 从只狼开始的交易人生 天道五千年 亚星游戏官网 万利游戏官网 万利官网 亚星游戏官网 澳门葡京官网 胶州申通快递总部电话号码是多少钱 江西萍乡邮政快递电话查询 江西萍乡邮政快递电话号码 揭阳成都顺丰快递电话 焦作李万邮政所电话 将乐邮政电话号码 江西新余泉塘申通快递电话号码 角美德邦物流电话号码 焦作区号电话号码 揭阳成都顺丰快递电话 胶州申通快递总部电话是多少钱 焦作顺丰快递公司电话 角美物流电话号码是多少钱 焦作李万邮政所电话 江阴市区顺丰电话号码 江西宜春公司电话 江西宜春公司电话 江西萍乡邮政快递电话 江西萍乡邮政快递电话查询 揭阳成都顺丰快递电话 揭阳普宁顺丰电话 焦作顺丰快递公司电话号码 江西新余泉塘申通快递电话 胶州申通快递总部电话号码是多少 江阴市区顺丰电话号码 蛟河邮局快递电话 胶州申通快递总部电话是多少钱 焦作山阳区顺丰电话 角美物流电话号码是多少钱 揭阳普宁顺丰电话