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
电影花田喜事2010具智成演过的电影分手不分手 电影铁猴子黄飞鸿电影老电影晚霞电影花田喜事2010中华英雄电影下载分手不分手 电影乐观的微电影关于文化的电影花与棋电影电影花田喜事2010美好2014大师微电影花与棋电影分手不分手 电影关于文化的电影三只猴子电影剧情老电影晚霞老电影晚霞猫眼网团购电影票连云港电影院今日影讯预告犯 电影 下载乐观的微电影猫王传记电影廊桥1937 电影有一个微电影讲的是男的特别好最后是男的的独白铁猴子黄飞鸿电影丹东电影院影讯猫眼网团购电影票电影色降灵兽人程森屮(che四声)十一岁丧母,十三岁遭灭族。程森屮,程猖,程狂兄弟三人幸存。一年后大哥程猖却操纵程森屮杀死小时密友和程猖,心灰意冷的程森屮消失了三个月后在长安佚名“山狼”靠杀人赚钱。两年后,“山狼”声名崛起无意间认识权门高氏二公子和洌氏二公,这时有人叫杀死两人。山狼不从,没曾想那人正是大哥程猖。几经挣扎后,山狼坠于程狂和卫天兰坠落的黑鹰崖。 十年后 顶级杀手——山狼,再次出现在高风舌眼前。 正义也许会迟到,但永远不会缺席。年轻的拳王重生,带着上一世神奇的力量,看他如何纵横哈利波特世界灵异+搞笑+器灵。 离奇失踪的合伙人让梁晓不得不接手调查社。 一个看似普通委托却让他接触到一个不一样的异世界。三年前,他家道衰落,被迫退婚! 三年后,他功成名就,强势归来! 作为战神,为了龙国安宁,他选择放下昔日仇恨;可让他没有想到的是,同袍竟利欲熏心,与仇人结盟谋害自己! 所幸天无绝人之路,林天权大难不死! 三年前,他能成就一方战神,三年后,他依旧能以天人之姿,让那些陷害自己的人,付出百倍、千倍代价! 时代无情,岁月流逝。想要成为天地间最强大的存在需,勿忘初心,面对世间种种困难,不惧因果,敢于尝试,学会放弃。豺狼当道,虎豹环视,一招不慎,便是万劫不复;心不狠,站不稳,杀伐果断,只为无上权力。萧子暮重生成婴儿,等反应过来自己已经夺了女帝修为。 “萧子暮,还我的修为。” “不然我让你死的很难看。” “听话,你虽然是女帝,但好歹是妹妹,小心我打你!” 女帝闭嘴,眼泪汪汪。 “乖!把你的修为再给我点吧。” 女帝破口大骂,只想一刀解决这个依靠自己灵力发育的天仙大帝!大乾末年,工业革命刚刚完毕,天下大乱,帝国第一纨绔、当朝皇帝的外甥、帝国三等侯爵高绍义忽然觉醒了地球的记忆,本以为可以娇妻美妾,继续纨绔下去,但现在的大乾帝国风雨漂泊,外有强敌,内有昏君,保命都是个问题,高绍义无奈走上自强之路,卖了祖产开启武器兑换系统。 嘟嘟,恭喜宿主兑换成功98K两千只。 嘟嘟,恭喜宿主兑换成功155毫米重炮20门。 嘟嘟...... 靠武器兑换系统和自己的聪明才智,高绍义对内铲除奸臣,对外四处征战。 平原上数万坦克装甲车如万马奔腾一般。 海洋上百艘航母为首的三大舰队为帝国签下数百份不平等条约。 高绍义大手一挥,三军踏平一切胆敢抗天朝者! 异世赌徒遇到当世疯子,风云变幻,看得他俩如何作死,在这人命如草芥的世界,如何为人类谋福祉呢?江泽白纵酒高歌,泪流满面,徒影自怜,不过是为了那几缕人间烟火。南宋的软弱无能,金人的侵袭,他不知道小园香径独徘徊了多少次。他小时候见过岳飞,并对他崇拜的不得了。直到有一天,年少的他看着漫天大雪,得知了岳飞的死讯......
大佬的游山记 星辰破千里 末日降临:我带着全族奔小康 异世界众横 神曰:降鬼师 僵尸始皇帝 慧空的梦 重生:回到八零当首富 胜利油田的三种精神 现代修真视录 大宋崛起 谷情封夕 阴阳,五行诀 穿越上古世界 围猎游戏 十四载烽火狼烟 旧雨集 重活四十年 护仙 剩男穿越成了小地主 具智成演过的电影 关于文化的电影 三只猴子电影剧情 老电影晚霞 具智成演过的电影 2015年1月30号上映的电影 乐高大电影观看 房子 房子我爱你 2009年电影 2015年1月30号上映的电影 美好2014大师微电影 大闹天宫甄子丹电影演员表 大闹天宫甄子丹电影演员表 猫王传记电影 关于文化的电影 电影花田喜事2010 廊桥1937 电影 于是之电影 有一个微电影讲的是男的特别好最后是男的的独白 具智成 电影 电影花田喜事2010 成年微电影观看 分手不分手 电影 具智成 电影 预告犯 电影 下载 房子 房子我爱你 2009年电影 电影西游记之大闹天宫演员表 有一个微电影讲的是男的特别好最后是男的的独白 具智成 电影 连云港电影院今日影讯 有一个微电影讲的是男的特别好最后是男的的独白 老电影晚霞 成年微电影观看 铁猴子黄飞鸿电影 电影花田喜事2010 猫王传记电影 廊桥1937 电影 电影院 韩语 乐高大电影观看 猫王传记电影 电影院 韩语 廊桥1937 电影 电影 西施 猫眼网团购电影票 于是之电影 花与棋电影 成年微电影观看 大闹天宫甄子丹电影演员表 廊桥1937 电影 电影西游记之大闹天宫演员表 中华英雄电影下载 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 重生之我在仙界修神系统 赛尔号之清玄灵地 鬼蜮:丑恶的人心 死亡祭禁 九州之帝 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 房子 房子我爱你 2009年电影 有一个微电影讲的是男的特别好最后是男的的独白 电影院 韩语 老电影晚霞 廊桥1937 电影 猫王传记电影 中华英雄电影下载 大闹天宫甄子丹电影演员表 电影西游记之大闹天宫演员表 猫眼网团购电影票 猫王传记电影 房子 房子我爱你 2009年电影 猫眼网团购电影票 分手不分手 电影 成年微电影观看 有一个微电影讲的是男的特别好最后是男的的独白 具智成 电影 铁猴子黄飞鸿电影 美好2014大师微电影 三只猴子电影剧情 中华英雄电影下载 预告犯 电影 下载 丹东电影院影讯 汉城大劫案 电影 三只猴子电影剧情 关于文化的电影 花与棋电影 连云港电影院今日影讯 成年微电影观看 电影 西施