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
德州直大营汽车时刻表深圳宝安到新宁汽车票开化萧山汽车站时刻表宜宾市到深圳的汽车票太原到襄垣汽车多久阆中市到汕头汽车票青田汽车站号码多少开化萧山汽车站时刻表盐城到北京汽车电话号码句容到宝华山有汽车吗龙岗到广州黄埔汽车客运站德州直大营汽车时刻表无锡到湖州汽车要多久吉首到宜昌汽车多少钱开化萧山汽车站时刻表句容到宝华山有汽车吗从济源到兰考的汽车奉化到千岛湖的汽车奉化到千岛湖的汽车广州南站到汕头汽车票多少钱唐山那个汽车站到滦南奉化到千岛湖的汽车盐城到北京汽车电话号码恩施到福清汽车站时刻表太原到襄垣汽车多久安阳至新乡汽车宜宾市到深圳的汽车票承德德州的汽车多长时间宝安汽车站到珠海横琴无锡到湖州汽车要多久侠客,了平生事,却心中念便是被放弃的水蓝星,资源枯竭,异变的人工智能,浩瀚的星空,使得走出水蓝星成为了每一个人的梦想。这里是武者的世界,苏南从一个初级武者,到最终成为宇宙级武者,一步步探寻父母意外离去的真相,为人类寻找合适的家园,不同文明的碰撞,末日的入侵……正在徐徐展开。一个一个的离奇案件接踵而至。。 所有的真理只是还原案件的一个出发点, 如果你是一个审理着,你会怎么做? 带着你的好奇,你的想象力来跟我一起走进这场博弈的游戏 唐末五代十国,军阀混战时期,外族趁乱而入,企图先霸武林,里应外合,再图中原天下。 一系水尊,九转玄阴之体,带领群雄,瓦解阴谋,驱除外敌,助后周太祖平定天下。唐轩只是一个普通的懵懂大学生,在鼓起勇气告白的这个夜晚,校花的突然来访改变了他平淡的人生。在惊悚与神秘的呼唤下,在爱与死的抉择下,他毅然选择了未知。王座高悬于上,陌生国度的大门向他缓缓开启。平凡的小人物走上不平凡的真理之路。然而王座的前面诡谲重重,当真相解开面纱,唐轩又该如何抉择? 是屠龙的少年终成恶龙,还是……颠覆整个世界。这是一个崭新的世界,在这个世界没有魔法斗气,只有五彩斑斓的元素充斥着整个世界. 每个人只要到了十岁就可以进行元素修炼,通过自身的感悟和运用进行战斗。 而这本书主要是讲述一个没有元素感知力的少年,是如何一步步称霸一方统领一界的......梦凡意外获得诡异角色(使徒) 莫名的角色改变了自己的一生 最后发现惊天秘密究竟自己究竟该如何选择 科技为刀有两面, 毁灭、创生一念间。 恶人持刀则为恶, 善人持刀则为善。 科技笼罩下的欲望狂野生长。 黑暗来临,动荡将起! 在这个天色已晚天未亮的世界中, 必然有人提刀换天明! 而在黑暗笼罩下的林清也将会成为其中的一员……不就是投了个好胎吗?有什么了不起的! 嗯嗯,真香! 出行保镖有多点,没有什么大问题!你看那遥远的星域,我家的! 兄弟,跟我混,包吃包住, 一天饿九顿!从小被称为天才异能师的叶凡一夜之间沦为废人,父亲为了医治他散尽家财,最后也没有恢复;夏家退婚、好友背叛、就连之前好说话的同学们也恶语相向,就在叶凡也绝望之时,通过异能石意外恢复火系异能并觉醒雷系异能,修炼速度加倍、突破也像喝水一样,他发誓要悄悄修炼,然后卷死所有人。
九域覆灭录 少爷,别怕! 弃子成龙 造梦无双花果山篇 大辰桓 带着系统穿越电影世界 异世界:法师之路 离魄长安行 至终是少年 韩生传 嗜血天团 我们的太平湖 桃源盖世小仙医 七神乱罪 重生之我在深城打工 最后一域 东北风云二十年:兴安岭秘闻 元宇神话纪年 天道: 灵玄传 金秀到罗香汽车时刻表 长沙机场有到汽车东站 从济源到兰考的汽车 奉化到千岛湖的汽车 金秀到罗香汽车时刻表 兰州 冶力关 汽车 贵阳至万州汽车票 开封有到保定的汽车吗? 安阳至新乡汽车 无锡到湖州汽车要多久 盐城到北京汽车电话号码 沙井汽车站到中山南头 恩施到福清汽车站时刻表 句容到宝华山有汽车吗 阆中市到汕头汽车票 太原到襄垣汽车多久 贵阳至万州汽车票 安阳至新乡汽车 唐山那个汽车站到滦南 德州直大营汽车时刻表 长沙机场有到汽车东站 开化萧山汽车站时刻表 深圳宝安到新宁汽车票 吉首到宜昌汽车多少钱 句容到宝华山有汽车吗 恩施到福清汽车站时刻表 安阳至新乡汽车 深圳宝安到新宁汽车票 唐山那个汽车站到滦南 安阳至新乡汽车 太原到襄垣汽车多久 长沙机场有到汽车东站 吉首有到益阳的汽车吗 德州直大营汽车时刻表 承德德州的汽车多长时间 太原到襄垣汽车多久 吉首有到益阳的汽车吗 贵阳至万州汽车票 恩施到福清汽车站时刻表 吉首有到益阳的汽车吗 太原到襄垣汽车多久 娄底到长沙东汽车 广州南站到汕头汽车票多少钱 沙井汽车站到中山南头 吉首到宜昌汽车多少钱 长沙机场有到汽车东站 盐城到北京汽车电话号码 宜宾市到深圳的汽车票 宝安汽车站到珠海横琴 青田汽车站号码多少 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 夜间工作者 朽魂万骨枯 我爱我的刘大叔 系统!我恨你! 娱乐:重回女儿去世前,爆红全网 亚星管理平台 亚星官网 万利游戏官网 亚星管理平台 澳门葡京官网 唐山那个汽车站到滦南 盐城到北京汽车电话号码 吉首有到益阳的汽车吗 衡山到台州汽车多久 安阳至新乡汽车 德州直大营汽车时刻表 安阳至新乡汽车 无锡到湖州汽车要多久 承德德州的汽车多长时间 无锡到湖州汽车要多久 龙岗到广州黄埔汽车客运站 青田汽车站号码多少 广州南站到汕头汽车票多少钱 贵阳至万州汽车票 广州南站到汕头汽车票多少钱 龙岗到广州黄埔汽车客运站 德州直大营汽车时刻表 广州南站到汕头汽车票多少钱 无锡到湖州汽车要多久 德州直大营汽车时刻表 宜宾市到深圳的汽车票 开封有到保定的汽车吗? 宜宾市到深圳的汽车票 安阳至新乡汽车 奉化到千岛湖的汽车 金秀到罗香汽车时刻表 沙井汽车站到中山南头 兰州 冶力关 汽车 长沙机场有到汽车东站 宝安汽车站到珠海横琴