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
为了你伤我的心歌词天之大完整歌词歌词中含这个城市好像很脏美洒加歌词爱情你在哪里是哪首歌的歌词为了你伤我的心歌词真心真意谢谢你的歌词歌词中含这个城市好像很脏奉献歌词曲谱太阳与月歌词再给我一次机会哪里的歌词歌词中含这个城市好像很脏回梦游仙 心然 歌词再给我一次机会哪里的歌词男朋友花心的歌词太阳与月歌词太极张三丰音乐随缘歌词歌词我的好兄弟你过的还好吗歌词我的好兄弟你过的还好吗晚安曲歌词王另类惊雷歌词歌词我的好兄弟你过的还好吗奉献歌词曲谱我爱你中国儿童歌曲歌词歌词我们就在一起是什么歌的歌词爱される花 中文歌词歌词我们就在一起是什么歌的歌词我爱你中国儿童歌曲歌词晚安曲歌词王回梦游仙 心然 歌词本来是一个小小客服被神选到了小说世界,没想到系统来晚了害我白等了十五年 没想到吧系统重启直接重新开始,黑暗森林我带着系统回来了!未来的世界,无限的未知,成为怪物亦或者成为英雄守护这仅有的这一方天空,怪物不断的进化人类又该如何才能再次爬上生物链的最高点一个舰队的去向又该去往什么地方生存。 没有任何人想要放弃,只要有一丝希望便要生存下去。[不要放弃,和我一起生存下去]这是一个普普通通的穿越故事,然而穿越了也不一定是主角,就比如夏子羽同学。“小姐姐,有事说话,别动手。”“小姐姐,先把剑放下。”“小姐姐,你又捡到宝物了吗?”……夏子羽陷入了沉思,“所以,谁才是主角?”奉师命下山治病的叶秋,凭借亿点点高强医术,让各路美人闻鸡起舞,无法自拔。 “叶秋,你除了医术高强,精通道卦玄术,有一堆国色天香的女人拥戴以外,你还是个啥?” “抱歉,我还是个美男子!”林子峰本是云天宗的内门弟子,庐州城林家的大少爷,一片前途光明,无奈被奸人所迫害导致成为一名颓废的乞丐…… “我恨呐” 我一定要报仇,我要变强,我要保护我所爱的人……我,叫做程刚,程是工程的程,刚是刚强的刚御兽时代,全民契约。 异界生灵将在100天后入侵蓝星。 前世,林秋因为防御太弱,没有熬过那百日之后的灾难。 重生的林秋,觉醒了神级御兽师天赋【大自在】,拥有了为其御兽自由加点的恐怖能力。 出于谨慎,他将自由属性点全点防御力。 一个远超想象的史诗时代出现在他面前……论剑道,他已剑意凝魂;论天资,他解人魔不和之体;论实力,他一人一剑一法一道杀尽世间之敌; 人魔共体的他被人魔所弃,魔族高贵的魔族公主,桀骜的人族太子,他又将何去何从……也许这辈子就这样了,既然一辈子也无法踏上仙途,那就让我这样死去吧! 饕餮? “折耳?卷毛?白色的?“ “你到底有没有眼力阿?!我有眉毛,眉毛你懂不懂,这是饕餮的最大外观特色阿。“ 放屁,你根本没有眉毛,我只看到你满脸白色卷毛 从来没人要收她当徒弟,突然一口气拜了两个师父,居然还是师父跪下来拜她为徒。 上辈子一世为人,她一只妖兽神兽都没见过,这辈子变成人妖遇到的全都是兽,人类,妖兽,恶魔,,三种种族出现地球上。但不断的战乱使天使与恶魔几乎灭绝。 而男主王昊天作为魔族后裔背负起振兴魔族的使命。
美漫之绝对掌控 黑源魔藉 我,修仙废物,御兽奇才 我可以被冈布奥附体 捣蛋闯天下 维度守护者 少年帝路 参生 是谁在敲响丧钟 南疆修仙传 圣穹寂 异域剑尊 尚武之地 内心的欲望 婢女之子的逆袭 游戏制作:我反向治愈玩家 异世界医院 神袛万岁 玄幻:赵高,一步一步往上 这个剑神有点浪 亲爱的你这么不在我身边歌词 再给我一次机会哪里的歌词 巴桑次仁拉索歌词 美洒加歌词 亲爱的你这么不在我身边歌词 歌词纸下载 巴桑次仁拉索歌词 baby许嵩歌词 天之大完整歌词 太阳与月歌词 歌词沙石 太极张三丰音乐随缘歌词 歌词:红尘 再给我一次机会哪里的歌词 晚安曲歌词王 美洒加歌词 真心真意谢谢你的歌词 天之大完整歌词 奉献歌词曲谱 回梦游仙 心然 歌词 亲爱的你这么不在我身边歌词 巴桑次仁拉索歌词 歌词我们就在一起是什么歌的歌词 奉献歌词曲谱 天之大完整歌词 baby许嵩歌词 歌词我的好兄弟你过的还好吗 歌词我们就在一起是什么歌的歌词 美洒加歌词 歌词我的好兄弟你过的还好吗 歌词沙石 亲爱的你这么不在我身边歌词 真心真意谢谢你的歌词 歌词是我的好兄弟是啥歌 countingstarts歌词 歌词沙石 真心真意谢谢你的歌词 晚安曲歌词王 baby许嵩歌词 巴桑次仁拉索歌词 太极张三丰音乐随缘歌词 爱される花 中文歌词 大中国歌词雨泉 歌词沙石 再给我一次机会哪里的歌词 countingstarts歌词 家乡有条河是哪首歌的歌词 歌词我们就在一起是什么歌的歌词 你到底爱谁伴奏有歌词 真心真意谢谢你的歌词 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 惊悚世界化身鬼医生 御世剑尊 女友宅的无气家主 乾坤阴阳图 只有我能杀死诡! 百度 百度 百度 百度 百度 真心真意谢谢你的歌词 歌词我们就在一起是什么歌的歌词 真心真意谢谢你的歌词 爱される花 中文歌词 家乡有条河是哪首歌的歌词 太极张三丰音乐随缘歌词 刀剑如梦吴亦凡歌词打印 歌词沙石 另类惊雷歌词 晚安曲歌词王 亲爱的你这么不在我身边歌词 太阳与月歌词 歌词我的好兄弟你过的还好吗 歌词纸下载 家乡有条河是哪首歌的歌词 歌词:红尘 baby许嵩歌词 真心真意谢谢你的歌词 你到底爱谁伴奏有歌词 歌词我的好兄弟你过的还好吗 刀剑如梦吴亦凡歌词打印 你到底爱谁伴奏有歌词 大中国歌词雨泉 刀剑如梦吴亦凡歌词打印 男朋友花心的歌词 baby许嵩歌词 男朋友花心的歌词 天之大完整歌词 歌词我们就在一起是什么歌的歌词 亲爱的你这么不在我身边歌词 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网