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
天门南到襄阳火车时刻慈利县到长沙火车站八面通火车承德到锦州的火车几点蓟州区到天津火车时间天门南到襄阳火车时刻邯郸离任丘多远火车八面通火车榆林到银川车有火车吗?六盘水市到兴义市的火车郴州去广西桂林火车时刻表八面通火车昆明-惠州火车票郴州去广西桂林火车时刻表六安到北京坐火车需要多长时间六盘水市到兴义市的火车莱芜市火车票电话是多少从贵阳到盘县火车时刻表从贵阳到盘县火车时刻表淄博至武安火车站呼和浩特至蓝旗火车票价从贵阳到盘县火车时刻表榆林到银川车有火车吗?无锡商丘的火车有几趟蓟州区到天津火车时间火车城站到骆家庄泰安至浙江萧山的火车时刻表无锡商丘的火车有几趟淄博至武安火车站昆明-惠州火车票 这是一个名为源气大陆的超级大陆;人们经参悟了源气的修炼方法,以修炼源气为主。产生了一些等级分别为凝气境,化源境,源丹境,源灵境,地化境,天象境,源皇境,尊者境,圣者境,至尊境,圣至尊,仙至尊,一个境界又分为九重天。在这里强者为尊,实力就是话语权。我的古董店今日又有客人说要听故事了,店里一个小姑娘却打碎了我最为珍视的照片,也罢,便讲个我的回忆好了......比别人的人心更可怕的,是自己的人心。关于回忆录,所谓回忆录,那就是什么时候想起来什么,什么时候更新好了.......没有比这个更离谱的事情了! 陈墨只不过喝了几口水,居然马上就要死了? 【你如果还想活命,来,献祭十年寿命,我告诉你方法。】 陈墨愣愣的看着脑海中,一盏青铜灯表面浮现的血色文字。 他登上一艘被黑气环绕的豪华游轮,没想到青铜灯上的文字却立刻更新。 【我不会告诉你,这艘船上能造成你死亡的因素,大概有六千多万个……】 他吃了一颗仙气盎然的果子,以为是主角光环降临,获得了奇遇,从此走上人生巅峰! 结果青铜灯浮现文字。 【你吃了一颗充满污染气息的水果,等着死吧……】 陈墨有点控制不住下巴,这是金手指? 点燃灯芯,可以获得超凡能力。 他充满期待的盯着青铜古灯。 【抱歉,你的脑袋进水了,点燃失败。】 陈墨没有穿越,但是他一直赖以生存的世界病了,他也病了。 “如果我还有得选,我希望继续以人类的身份活下去。” 时代无情,岁月流逝。想要成为天地间最强大的存在需,勿忘初心,面对世间种种困难,不惧因果,敢于尝试,学会放弃。班里的美少女转校生告诉我,我们已经被卷入了一场狼人杀游戏当中,随时会死? 可是......为什么我的狼人杀,画风不一样? 深夜,无人居住的房间里传出了诡异的声音, 黑暗的海洋馆深处传来了阵阵婴儿的啼哭声, 桃花盛开的小村庄在黑夜里露出了血色的獠牙...... 我能不玩了吗......穿越成禽满四合院的傻柱,绑定一个神级选择系统,越怼奖励越丰厚! 开局怒怼贾家恶婆婆,谁让她不怀好意多管闲事! 秦淮茹?给我介绍对象?请立刻滚蛋。 三大爷给我献殷勤,我不吃这一套! 别看傻柱前世是个老好人,现在的他可800个心眼子! 重生四合院,正好治一治你们这些禽兽!!!我因为贪婪,把自己卷进了一个未知的领域。   随之拼命挣扎,但无济于事。   遇到了很多,也挣扎过很多。   明白了许多,也失去了很多。   我不知道当天再亮起来的时候,我还能再次睁开眼睛。   或者是永远的沉睡。   神魔的游戏,养蛊人类,是举刀拿剑逆战万族,还是低眉俯首甘为奴仆,普通人的野望,你我是否都幻想过打破秩序,生与死,血与泪,离别与重逢,种种的选择,这是一部笑中含泪的作品,且看普通人如何末世中挣求活,选择自己的人生。世间,是否只是黑与白 任何不被认可的,难道就都是“暗” 若世间不去探求真理,那便让真理,来诠释这乱世一桩案件被警察轻易结案。随着遗书的流出,事件有了新的进展。真相到底是什么?到底是道德的沦丧还是人性的扭曲呢?
哀须臾 墨墨山海色 千年阴谋之谋 幸运的灵魂 封神鉴榜人 我在妖邪世界无限制升级 仙人世界 凹凸CP故事集 半神之坠 转灵诀 隐夜人 我的穿越鉴宝之旅 九灵圣神 从学园开始当主神 剑飞大陆 天成! 天呐!我变成了器灵 黄帝内经续 元宇宙:重生进化路 游走世间 南京南到南京的火车 铜陵火车站时间表 莱芜市火车票电话是多少 蓟州区到天津火车时间 南京南到南京的火车 火车票哪个车厢补票 莱芜市火车票电话是多少 新都至成都火车东站 火车城站到骆家庄 6月11日襄阳至武昌火车 榆林到银川车有火车吗? 黄岩去火车站 武昌到开封的普通火车票多少钱 铜陵火车站时间表 天门南到襄阳火车时刻 蓟州区到天津火车时间 深圳市到南阳火车站 火车城站到骆家庄 阿克苏几点开售火车票 八面通火车 铜陵火车站时间表 六安到北京坐火车需要多长时间 慈利县到长沙火车站 郴州去广西桂林火车时刻表 六盘水市到兴义市的火车 武昌到开封的普通火车票多少钱 火车城站到骆家庄 慈利县到长沙火车站 阿克苏几点开售火车票 火车城站到骆家庄 蓟州区到天津火车时间 德清到北京火车票 承德到锦州的火车几点 天门南到襄阳火车时刻 无锡商丘的火车有几趟 蓟州区到天津火车时间 承德到锦州的火车几点 莱芜市火车票电话是多少 武昌到开封的普通火车票多少钱 六安到北京坐火车需要多长时间 泰安至浙江萧山的火车时刻表 6月11日襄阳至武昌火车 遂宁至肇庆的火车时刻表 深圳市到南阳火车站 郴州去广西桂林火车时刻表 铜陵火车站时间表 黄岩去火车站 泰安至浙江萧山的火车时刻表 武昌到开封的普通火车票多少钱 邯郸离任丘多远火车 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 异世界保命 时空穿越笔记 太虚无上 空心飞天斩 亡灵支配者 万利游戏官网 欧博游戏官网 欧博官网 万利游戏官网 AG真人 火车城站到骆家庄 六盘水市到兴义市的火车 六盘水市到兴义市的火车 无锡商丘的火车有几趟 武昌到开封的普通火车票多少钱 南京南到南京的火车 六安到北京坐火车需要多长时间 淄博至武安火车站 德清到北京火车票 昆明-惠州火车票 火车城站到骆家庄 天门南到襄阳火车时刻 6月11日襄阳至武昌火车 无锡商丘的火车有几趟 深圳市到南阳火车站 火车城站到骆家庄 南京南到南京的火车 铜陵火车站时间表 铜陵火车站时间表 无锡商丘的火车有几趟 无锡商丘的火车有几趟 慈利县到长沙火车站 南京南到南京的火车 武昌到开封的普通火车票多少钱 天门南到襄阳火车时刻 蓟州区到天津火车时间 从庐江到无锡的火车时刻表 榆林到银川车有火车吗? 铜陵火车站时间表 莱芜市火车票电话是多少