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
湖北武汉天气穿衣哈尔滨三十天气温查询湖北孝感应城30天天气预报湖北英山未来30天气预报2017年10月3日厦门天气湖北武汉天气穿衣2016年8月黄石天气湖北孝感应城30天天气预报恩施市十月份天气2017年石家庄天气记录2017年十月黄石天气预报湖北武汉天气穿衣4月1号武汉天气2017年十月黄石天气预报湖北孝感应城30天天气预报2017年石家庄天气记录2016年湖北11月天气2017年10月4日黄石天气预报2017年10月4日黄石天气预报湖北黄石浠水天气预报甘肃榆中马衔山天气预报2017年10月4日黄石天气预报恩施九月份天气状况黑龙江哈尔滨30天天气预报2017年10月3日厦门天气河北昌黎一月天气预报湖北英山未来30天气预报黑河一个月天气湖北恩施11月中旬天气预报4月1号武汉天气意外穿越得到吞噬系统,机遇不断,得圣体,融妖魔,一身修为全靠吞! 不会后宫,女主一个。 偏向传统修真,多年前就想写一本修真,现在才落笔,学历有限,文笔不润,我尽量叙述我想描绘的世界。天下第一门派的天穹剑派的坐镇人竟是魔族万人之上的魔尊,在市井之人的讨论中,背后那段鲜为人知的往事也被逐渐揭开……农小乐见义勇为,却被人打成瞎子;因祸得福获得古医针道传承。一场误会,让农小乐陷入红粉佳人的圈子。老话说戏子无情,可是接下来农小乐所遇到的“戏子”,却是与众不同。人生无常,本应平凡一生,却因针道传承,发现自己的身世之谜。本应平平淡淡,却因针道传承得知古医术分歧;为保住古医,不惜只身对抗一切邪恶力量……(都市+系统+搞笑+腹黑) 摩天轮上无数情侣正在恩爱。 张北哼着小曲,按下了红色的按钮。 身处于百米高空的摩天轮突然停住。 随后竟然横了过来。 无数坐在椅子上的情侣被弹射到了半空,仅有一个绳子连接。 几秒种后,整个摩天轮就像一个飞速旋转的盘子。 无数情侣在半空中玩起了温馨和谐的游戏。 跳楼机上,九十米高空的人体悠悠球。 碰碰车上,充满僵尸鬼怪的地下逃亡。 医生看着刚刚从过山车上下来的游客,将一颗速效救心丸塞进了壮汉的嘴中。 眼神中充满了幽怨。 “老板,这么下去会死人的!” “不会,你看他们多开心!”冷风如刀,以大地为砧板视众生为鱼肉;飞雪似剑,以苍穹为帷幔斩现实为红尘。 天下纷扰由剑起,世间忧愁识字出。 吾愿以己为祭品,换得世间永太平。 【新书发布,只为创造经典】本作品已经废除,特此告知书友本是闲云野鹤,逍遥自在,可各位长老算出高景行有拯救苍生命,于是高景行孤身游历百川海,为救千万人  常定宇穿越民国,成为当地乡绅子弟,激活《世界首富》系统,并青春永驻,容颜一直停留在了二十出头。 但他无心壮大个人财富,反而创办大学,抗击奴人,屡立奇功,身上伤疤无数。   最终因为系统原因,常定宇战争尚未结束就直接进入了活死人的状态,直到百岁生日这一天才苏醒过来。   一日,常定宇骑着电动车和大妈相撞,被大妈诬陷碰瓷。   围观的路人纷纷对他指指点点。   “年纪轻轻的干什么不好,竟然也学老人碰瓷,一个大小伙子,你害臊不害臊?”   常定宇非常气愤,他从来没被人这么冤枉过,想上前理论,结果被大妈扯坏了衣服。 一身伤疤触目惊人,众人都傻了……我,苏杭在杭州是一名的哥,还是一名常年没人来打车的的哥,生活无望 但在另一个世界,神州,我是轻功第一兰梦蝶师傅的徒弟,修真第一家族揭岳的开门弟子,边怀抱美人,边俯瞰世界东方君从小无法修炼使其实力微弱,但因一次机遇,激活了体内沉睡着的黄金圣龙,就此获得了不属于这个大陆的力量,从此实力超凡。 结束了东面西方的明争暗斗,最终成为人类的第九代战神,并渡劫成真神。
我在异界当兽医 来,让我碾死你们 法武封圣 超级警员申请出战 龙珠之重生孙悟空 缚天咒君 无限调查团 都市最强高富帅 命之途 丑嬉 废土之上 苟成修仙大佬的我被狐帝老 乱世的故事 元宇宙:重生进化路 无知的凶手 虚无军团 笑谈千古风流事 仙运再临 英雄无敌之乱世幻想 我真的穿越了吗? 黑龙江哈尔滨30天天气预报 4月1号武汉天气 恩施市十月份天气 2017年十月厦门天气预报 黑龙江哈尔滨30天天气预报 湖北黄石浠水天气预报 甘肃榆中马衔山天气预报 2016年8月黄石天气 湖北恩施11月中旬天气预报 2016年嘉善11月份天气 哈尔滨一个月内的天气预报 哈尔滨三十天气温查询 湖北武汉天气穿衣 4月1号武汉天气 湖北英山未来30天气预报 2017年十月厦门天气预报 甘肃榆中马衔山天气预报 湖北恩施11月中旬天气预报 河北秦皇岛一月天气预报 2017年10月3日厦门天气 4月1号武汉天气 2017年10月4日黄石天气预报 黑河一个月天气 25号嘉善县天气 4月26武汉天气 湖北武汉天气穿衣 湖北恩施11月中旬天气预报 黑河一个月天气 河北秦皇岛一月天气预报 湖北恩施11月中旬天气预报 2017年十月厦门天气预报 4月1号武汉天气 2017年10月黄石天气 湖北英山未来30天气预报 湖北省蕲春一个月后天气预报 2017年十月厦门天气预报 2017年10月黄石天气 恩施市十月份天气 湖北武汉天气穿衣 2017年10月4日黄石天气预报 2017年十月黄石天气预报 2016年湖北11月天气 湖北黄石浠水天气预报 恩施二日游天气 2017年10月黄石天气 2017年十月厦门天气预报 恩施九月份天气状况 湖北英山未来30天气预报 湖北恩施11月中旬天气预报 2016年8月黄石天气 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 校花女神别脑补,我们双向暗恋了 一代妖相 舍我尊者 大清末年 弘文盛夏 快连下载 亚星游戏官网 亚星官网 快连下载 亚星管理平台 4月1号武汉天气 河北秦皇岛一月天气预报 湖北英山三月天气 黑龙江哈尔滨30天天气预报 河北秦皇岛一月天气预报 2017年十月黄石天气预报 黑河一个月天气 湖北黄石浠水天气预报 2017年10月黄石天气 湖北省蕲春一个月后天气预报 恩施九月份天气状况 湖北孝感应城30天天气预报 恩施九月份天气状况 4月26武汉天气 恩施市十月份天气 2017年10月3日厦门天气 哈尔滨一个月内的天气预报 2017年10月3日厦门天气 4月1号武汉天气 2017年10月黄石天气 2017年10月3日厦门天气 恩施九月份天气状况 2017年10月4日黄石天气预报 2017年石家庄天气记录 2016年嘉善11月份天气 2017年石家庄天气记录 湖北省蕲春一个月后天气预报 25号嘉兴市嘉善县天气 湖北黄石浠水天气预报 河北昌黎一月天气预报