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
狗狗带上飞机的规格狗狗得犬瘟喝葡萄糖狗狗带上飞机的规格狗狗蛋蛋周围有皮屑狗狗到几个月定型狗狗代养机构狗狗得了细小哼哼狗狗带上飞机的规格狗狗得了细小注意什么狗狗得结石什么原因狗狗得病细小狗狗带上飞机的规格狗狗得了球虫怎么诊治狗狗到哪里去办狗证狗狗戴上眼镜狗狗得结石什么原因狗狗得了细小临死症状狗狗到了晚上全身痒狗狗到了晚上全身痒狗狗代训怎么样狗狗得皮疹怎么办狗狗到了晚上全身痒狗狗得了细小注意什么狗狗大小便失禁瘫痪狗狗到几个月定型狗狗得细小偏方吗狗狗蛋蛋周围有皮屑狗狗大小便失禁瘫痪狗狗代训怎么样狗狗得了球虫怎么诊治我叫祝无双,原本是地府的一名鬼差,因为某些操蛋的理由,我被阎王派到阳间,去做一名高中女生的监护人。东华生上一世醒来就已经是高手了,在太虚幻境内经过一场大战后,他莫名其妙的转世重生到了六界中的人界,他努力的修炼,想要搞清楚一切,可是越是了解他就越是觉得自己身陷局中。蓝星被神秘力量激活了生命能量收割程序,末日降临,是生命的终焉,也是生命进化突破桎梏的初始。 魏昱意外激活血脉传承水晶,突破层层生命桎梏枷锁。 且看魏昱如何在这人心险恶的末世之中,诛小人,杀怪物,屠圣母,做自己想做的事,救自己想救的人,杀自己想杀的人。 魏昱说:“我只想做一个属于自己的好人。” 【寂寞不谈爱,孤独不饮酒。】 女儿生日当天,我意外看到了妻子的手机,当谎言被揭穿的时候,我发现妻子真的很懂“生活。” 待我归家 山河无恙 代我归家 亲人安康 带我归家 魂归故里 生若为男即杀人,不教男躯裹女心。男儿从来不恤身,纵死敌手笑相承身患绝症的叶文偶得太极拳的真传,并且觉醒了弘扬武学系统! 只要他用武学影响更多人,就能获得积分,兑换顿悟机会,获得各种高阶武学! 甚至,治好自己的病。 从此,叶文开启了他的练武直播! 拳震所有武林宗门,脚踏世间不服之人! 只有你想不到的招式,没有我治不了的高人! 所有人都要恭恭敬敬地,在键盘上叫一声“武神”。 叶文:“货真价实的太极拳要不要学?飞檐走壁的梯云纵要不要了解一下?不要?早晚你要跪地求着我要!”人间难有清醒客,你我都是世俗人。在不断成长的过程中,观遍世界奇事,尝尽人生苦甜,才发现自己只是你的一枚棋子,可是这又有什么关系呢,你天生就该是这世界的主角,我会变强一直陪着你……陈树和大学死党顾清两个人玩游戏喝酒。 输了一轮游戏,死党竟然整活把女总裁拉进了陈树的家庭群。 第二天醒酒之后,陈树才发现女总裁在群里聊嗨了! 本来以为自己被即将被炒鱿鱼了,却发现女总裁的要求一个比一个离谱。 陈树,到我办公室来。 陈树,跟我回家见父母。 陈树,我们同居吧。 面对女总裁的要求,陈树无法拒绝。 直到有一天,女总裁含情脉脉地向陈树求婚。 陈树:不是假扮情侣吗?你怎么玩真的?异能者的觉醒,使人类面临着悬崖上的抉择。 强权与堕落,腐朽与血腥,谁来拯救混乱中的大陆? 一枚少年。 一个系统。 一句真言。 赫赫有名的“白金”成就满级玩家,在删除账号却误入了新的时间,本以为是系统BUG,没想到却在这里开启了新的人生
光冥天星 重生东汉末年之我为刘协 层叠世界 异世代:平行地球流浪记 月下祈光者 墓诡异志 灵异:黑暗最深处 废材闯三界之水族传奇 天才的异世界之旅 都市重生之剑仙归来 草莽也能是英雄 云飞志 神怒1 帝王医婿 冷宫拔剑三百年,我成了绝世剑仙 落晴鸢 太阳从西边升起 魔鬼鱼海贼 末世求生:我能随时伪装新身份 迷灵诡探 狗狗得细小该怎么办 狗狗得传染病症状 狗狗得了细小临死症状 狗狗到几个月定型 狗狗得细小该怎么办 狗狗大小便报纸 狗狗得了细小无精打采 狗狗得了蜱虫浑身没力 狗狗得细小偏方吗 狗狗得了蜱虫咋吧 狗狗得了细小注意什么 狗狗得了细小奄奄一息 狗狗代买 狗狗得传染病症状 狗狗代养机构 狗狗到几个月定型 狗狗得了细小无精打采 狗狗得细小偏方吗 狗狗得皮疹怎么办 狗狗带上飞机的规格 狗狗得传染病症状 狗狗戴上眼镜 狗狗得犬瘟喝葡萄糖 狗狗到哪里去办狗证 狗狗得结石什么原因 狗狗代买 狗狗得细小偏方吗 狗狗得犬瘟喝葡萄糖 狗狗得皮疹怎么办 狗狗得细小偏方吗 狗狗到几个月定型 狗狗得传染病症状 狗狗蛋蛋有褐色的皮屑 狗狗代养机构 狗狗大小便失禁瘫痪 狗狗到几个月定型 狗狗蛋蛋有褐色的皮屑 狗狗得了细小临死症状 狗狗代买 狗狗戴上眼镜 狗狗蛋蛋周围有皮屑 狗狗得了蜱虫咋吧 狗狗代养好吗 狗狗得了细小奄奄一息 狗狗到哪里去办狗证 狗狗得传染病症状 狗狗得了细小奄奄一息 狗狗蛋蛋周围有皮屑 狗狗代买 狗狗得了细小哼哼 亚星官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 都市逍遥医圣 我成了神国最后的希望 镇国大帅 古海有云 神樱祝祷 欧博官网 百家乐官网 亚星管理平台 欧博官网 亚星游戏官网 狗狗得了细小注意什么 狗狗大小便失禁瘫痪 狗狗得了细小注意什么 狗狗得了细小临死症状 狗狗得皮疹怎么办 狗狗得病细小 狗狗得了蜱虫浑身没力 狗狗得结石什么原因 狗狗得细小偏方吗 狗狗得螨虫用吃药吗 狗狗得细小偏方吗 狗狗蛋蛋有褐色的皮屑 狗狗蛋蛋周围有皮屑 狗狗得细小偏方吗 狗狗得了细小临死症状 狗狗蛋蛋周围有皮屑 狗狗到哪里去办狗证 狗狗到了晚上全身痒 狗狗代养好吗 狗狗代买 狗狗得传染病症状 狗狗得了细小奄奄一息 狗狗得皮疹怎么办 狗狗得螨虫用吃药吗 狗狗得了蜱虫咋吧 狗狗带上飞机的规格 狗狗到几个月定型 狗狗得了球虫怎么诊治 狗狗得了细小哼哼 狗狗得了球虫怎么诊治