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
宫崎耀司 小说小说 诅咒世界宫崎耀司 小说强奸幻想 小说沧月 小说名字重生洪荒之不朽 紫玉佛莲 小说关于 养子 奴隶 仆人的 小说魔法小说 男主角刚开始跟朋友一块流浪后面通过魔法很有钱满朝文武爱上我 云霓 小说求一本小说里面给主人公四个保镖分别叫追命冷血悟空传 今何在 小说宫崎耀司 小说腹黑首席替身妻 她的国 小说万妞莫挡 吾本纯洁 小说魔法小说 男主角刚开始跟朋友一块流浪后面通过魔法很有钱求一本小说里面给主人公四个保镖分别叫追命冷血华清王妃 路晨夕 小说冒牌杀手混都市 航空舞剑 小说冒牌杀手混都市 航空舞剑 小说杀狱 天朝书生 小说女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说冒牌杀手混都市 航空舞剑 小说满朝文武爱上我 云霓 小说紫薇湖畔 痞子羽 小说沧月 小说名字穿越火线之超越极限 小宇1083946879 小说强奸幻想 小说紫薇湖畔 痞子羽 小说杀狱 天朝书生 小说腹黑首席替身妻 她的国 小说神魔的游戏,养蛊人类,是举刀拿剑逆战万族,还是低眉俯首甘为奴仆,普通人的野望,你我是否都幻想过打破秩序,生与死,血与泪,离别与重逢,种种的选择,这是一部笑中含泪的作品,且看普通人如何末世中挣求活,选择自己的人生。生于黑暗之中的无奈,却背上救赎大陆的责任,在阴谋诡计中行走,与兄弟朋友的手足情深,与恩师结束乱世纷争光与影谁更邪恶,破解之谜。 为了逃婚,他随便找了个美女合租,不料她竟是自己未见过面的未婚妻。 为了赚钱,他信手炼制了几枚丹药,不料竟做成了天下第一的医药公司。 为了修行,他顺手收了几个女徒弟,不料她们竟都有着惊世骇俗的身份。 为了救人,他甘愿自废一生之修为,不料所救之人竟是艳绝天下的女帝。 为了复仇,他勤修苦练至大功告成,不料最大的魔头之主竟是……穿越洪荒,成为帝俊和东皇太一长兄。 深知后世巫妖量阶走向的道尘,当即决定带着两个小老弟,闭关太阳星,打死不踏出一步。 自此洪荒天机发生变化,妖族无主,巫族一家独大。 圣人一个脑袋两个大。 鸿钧:你出关,圣位灵宝随你挑。 洪荒大妖:求求你出关吧,巫族太凶了。 系统:宿主求求你出关吧,三清和十二祖巫,人头打出狗脑子了。 道尘:不存在的,等我再闭个十个八个元会再说。 无尽世界有无尽故事,无尽故事,生无量因果。因果纠缠之下,必有逢厄遭难后不能释怀者。 冰消为博一线成人造化,穿梭诸多世界,证神魂唯一。解彼灾厄,全我机缘。作品讲述的是一个走投无路的人向死而生的过程。由于种种离奇的机缘与遭遇,被迫踏上自己从未想象过的奇妙旅程,最终他的命运会是如何?是生?是死?...大武王朝,邪异降临,诡异杀人于无形。 江夜携带修改器穿越。 燃血功+一气功,破极【炎阳神功】。 牛魔大力拳+十三太保横练,破极牛魔大力拳.真意。【牛魔真身】 狂风刀+黑虎刀法,破极【霸刀诀】。 疾风掠影+御风步,破极【御风隐形】轻功。 生死看淡,不服就干,这是一个以蛮力,武道,横推一切的故事。万年轮回,黑暗再临,千万年的阴谋,谁能破局?……一柄神秘的古剑,一处尘封的遗迹,当世界的真相展现在世人眼前,人们该何去何从?是反抗还是妥协?……手中的剑为什么挥动?只有靠你自己寻找答案!修炼界流传着只要跟沈于安成为朋友便会被他给带歪。 只因他满口的歪道理,而你会在不知不觉间认同他的道理,甚至是对他所说出的每一个道理都近乎于疯狂的崇拜,病态的崇拜。 他的歪道理甚至是能够帮助他人顿悟。 直到有一天沈于安告诉世人其实不需要苦修就能提升修为,这让人一听不就是妥妥的歪理吗? 众修士:“不苦修怎能提升修为?” 沈于安:“那你们用过我研究出来的道具没?” 众修士:“什么玩意?” 沈于安:“都是一群土鳖。” 众修士:??(◣д◢)?? 本书又叫:(思想不端正,歪理来矫正) 本书又叫:(本公子有一口流利的歪道理) 本书又叫:(沈大公子的歪道理满天飞) 本书又叫:(我的歪道理是用来引导人的) 本书又叫:(异界大哲学家,大道具师) 本书又叫:(唯我沈大公子的歪理能通神)
次元大陆:中星 永恒浩瀚 阴阳幽遇 天梦神阁图书馆 穿越:开局落凤床 十方世界,我为地仙之祖 轮回的诅咒 永恒圣剑之天之痕 魂穿之我是雷帝 一胎三宝:爵爷娇妻火辣辣 第二世:上帝的节目 杀手的小可爱 异界修真之无上帝尊 众生浩劫 大宋萧魔王 张泊宁校园争霸赛 玄能通天 虚拟世界之飞翔的飞猪 清除 求戟 晨曦全本小说网 死亡同学录 仲夏二月 小说 华清王妃 路晨夕 小说 冒牌杀手混都市 航空舞剑 小说 晨曦全本小说网 孪心记 六目 小说 韩国遭遇我的天才王子 小说 青春小说 下载 穿越火线之超越极限 小宇1083946879 小说 腹黑首席替身妻 她的国 小说 满朝文武爱上我 云霓 小说 冬至夏 小说 重生之满地桃花香 应素达 小说 死亡同学录 仲夏二月 小说 重生洪荒之不朽 紫玉佛莲 小说 沧月 小说名字 韩国遭遇我的天才王子 小说 穿越火线之超越极限 小宇1083946879 小说 女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说 宫崎耀司 小说 死亡同学录 仲夏二月 小说 魔法小说 男主角刚开始跟朋友一块流浪后面通过魔法很有钱 小说 诅咒世界 万妞莫挡 吾本纯洁 小说 求一本小说里面给主人公四个保镖分别叫追命冷血 重生之满地桃花香 应素达 小说 穿越火线之超越极限 小宇1083946879 小说 小说 诅咒世界 女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说 穿越火线之超越极限 小宇1083946879 小说 沧月 小说名字 死亡同学录 仲夏二月 小说 寂灭天寂 天宇之溪 小说 宫崎耀司 小说 紫薇湖畔 痞子羽 小说 沧月 小说名字 寂灭天寂 天宇之溪 小说 华清王妃 路晨夕 小说 重生之满地桃花香 应素达 小说 魔法小说 男主角刚开始跟朋友一块流浪后面通过魔法很有钱 强奸幻想 小说 派派小说 原创要什么权限进去? 古风小说 挺长的 冬至夏 小说 万妞莫挡 吾本纯洁 小说 死亡同学录 仲夏二月 小说 冬至夏 小说 强奸幻想 小说 重生之满地桃花香 应素达 小说 关于 养子 奴隶 仆人的 小说 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 太古之神 也曾轻狂 长安悬疑录 水行:上 碧海之蓝 葡京官网 快连下载 欧博官网 葡京官网 欧博官网 满朝文武爱上我 云霓 小说 孪心记 六目 小说 华清王妃 路晨夕 小说 宫崎耀司 小说 小说 诅咒世界 悟空传 今何在 小说 悟空传 今何在 小说 孪心记 六目 小说 孪心记 六目 小说 女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说 重生洪荒之不朽 紫玉佛莲 小说 紫薇湖畔 痞子羽 小说 万妞莫挡 吾本纯洁 小说 派派小说 原创要什么权限进去? 小说 诅咒世界 杀狱 天朝书生 小说 求一本小说里面给主人公四个保镖分别叫追命冷血 穿越火线之超越极限 小宇1083946879 小说 关于 养子 奴隶 仆人的 小说 小说 诅咒世界 女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说 万妞莫挡 吾本纯洁 小说 万妞莫挡 吾本纯洁 小说 穿越火线之超越极限 小宇1083946879 小说 孪心记 六目 小说 冷酷王子vs倾城公主 柔~思念 小说 女主角姓蓝家里有一个胖老爸和五个妖孽大哥当过一阵子明星的小说 紫薇湖畔 痞子羽 小说 杀狱 天朝书生 小说 寂灭天寂 天宇之溪 小说