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
金华到巍山汽车深圳市蛇口沃尔玛到罗湖汽车站坐的士多少钱北京到野三坡汽车泗洪汽车义乌到嵊州汽车时刻表金华到巍山汽车重庆菜园坝到合江汽车时刻表北京到野三坡汽车绍兴北站到宁波汽车潍坊长途汽车站订票宁波汽车南站临时站北京到野三坡汽车嘉兴市到泗洪县长途汽车宁波汽车南站临时站荣县至成都汽车时刻表潍坊长途汽车站订票铜陵到池州石台汽车绵阳到都江堰汽车时刻表绵阳到都江堰汽车时刻表湖州到上海的汽车要多久盐城到无锡汽车几个小时绵阳到都江堰汽车时刻表绍兴北站到宁波汽车金华汽车南站到永康汽车时刻表慈溪到嘉善西塘的汽车萍乡到吉安汽车慈溪到嘉善西塘的汽车金华汽车南站到永康汽车时刻表湖州到上海的汽车要多久嘉兴市到泗洪县长途汽车中华大地,文化博大精深,源远流长,造就一批批的文人才子,王侯将相,普通大众,也就是再这样的情况下,成就今天的中华文化,中华精神。 从小民百姓到达官贵人,从富丽堂皇到乡野之地,从雍容华贵到下里巴人,在这里,我们将会一一领会 文王到始皇,汉高祖到唐太宗,以及王侯将相宁有种乎,都在这里尽情的展翅高飞,发挥属于自己的时代欲望与愿望,仇恨与守护...... 名为“奇迹”的力量往往需要付出代价 这是关于少年北星河,不堪忍受命运的安排,通过“奇迹”逆天改命的故事。 三岁,亲人就被阴兵抓走,自此妖魔横行,要自我于死地,又被飞僵追杀,道门的背叛。清末,列强纷纷侵入中国,他们在中国领土上横行霸道,任意划分势力范围,中国民族危机日益加深,百姓生活在水深火热之中。伴随列强入侵的西方传教士打着传播福音的旗号,勾结官府,鱼肉百姓,招收了大量不法教民。在其庇护下,教民为非作歹,欺压良善,激起民众的普遍痛恨,民教冲突不断升级,以“扶清灭洋”为口号的义和团悄然兴起。戊戌政变后,保守派得势,他们迷信义和团刀枪不入的神功,欲借其达到排外的目的,在保守派的纵容和推动下,义和团迅速发展壮大,他们毁铁路、拔电杆、烧教堂、杀教民,逐步由山东直隶进入京师。列强大为恐慌,以保卫使馆和传教士为由,组建八国联军攻陷北京,慈禧太后携皇亲国戚仓皇西逃,留下千年古都被洋人蹂躏……武朝妖魔横行,天帝下令肃清人界妖邪,司法仙官林墨阳奉命除妖。 抓妖怪,谈恋爱。 笑看天地间掀起这场巨大波澜,芸芸众生万般命,一剑出鞘定乾坤!天龙国皇权覆灭后百年来有三个派系组成,士族派,中立派,变革派维持着整个国家的平衡。 但因为一个二三岁的男人改变了这种平衡,他为变革派代表,一心想要铲除世家门阀让国家成为一个人人平等的国度。武道一途,逆命而上! 人欲拦我,屠人! 神欲拦我,斩神! 天欲拦我,灭天! 道欲拦我,伐道! 命运蹉跎又能如何,三尺青锋,一剑斩之!王富贵一觉醒来发现自己穿越到一个破落户家里,一出门还白捡了个老婆,为了养活一大家子,王富贵不得不想方设法搞钱!设计时装、建造工厂,到后来居然连手机都有了……王富贵就这么成为大夏第一号大富豪,还顺便收个皇帝做小弟!一名少年天赋异禀,因被手足残害险些命丧他手,不曾想因祸得福在机缘巧合之下寻得仙界神兵。当绝世神兵再现,引仙魔觊觎之时,他又将迎来一场怎样的命运呢?生命就是一场经历。没了高中的紧张,大学里放松了很多。 思想上的经历,可以通过多读书来实现。但生活上的经历,只能是自己切身体会。 大学四年,在酒吧兼过职,处了舞蹈系最漂亮的女朋友,球场上跟体育生比过武,跟英语专业最牛逼的男生交了朋友,社团招新上出名全校,也受过其他学生的欺凌,看到过同学生命的逝去,也一直结识更多新的朋友。 小说来源于现实,现实又何尝不是一部小说。
九州战魂 疯狂的禽兽 影视世界从一千万开始 轮回选择 落叶随风至天台 笔下之物 骨董江湖 红都酒楼 大唐说书人:揭秘玄武门,李二懵了 成为恶蛟加点修仙 归去龙兮 星之复苏 度魂刀笔师 全球冰封:我为人族守护神 异常 序章 长生三千事 李毅破天 玄珠记 猎艳神医 开局一头牛 杭州到玉环的汽车时刻表 中牟汽车站 铜陵到池州石台汽车 义乌到嵊州汽车时刻表 杭州到玉环的汽车时刻表 乐山到峨眉山汽车票价 铜陵到池州石台汽车 常州汽车北站网上订票 萍乡到吉安汽车 慈溪到嘉善汽车 沈阳汽车站订票 沈阳汽车站订票 长安汽车站到常平火车站 中牟汽车站 金华到巍山汽车 义乌到嵊州汽车时刻表 常州机场到常州汽车站 萍乡到吉安汽车 杭州至桐乡汽车 北京到野三坡汽车 中牟汽车站 荣县至成都汽车时刻表 深圳市蛇口沃尔玛到罗湖汽车站坐的士多少钱 宁波汽车南站临时站 潍坊长途汽车站订票 长安汽车站到常平火车站 萍乡到吉安汽车 深圳市蛇口沃尔玛到罗湖汽车站坐的士多少钱 杭州至桐乡汽车 萍乡到吉安汽车 义乌到嵊州汽车时刻表 三台到中江汽车 泗洪汽车 金华到巍山汽车 金华汽车南站到永康汽车时刻表 义乌到嵊州汽车时刻表 泗洪汽车 铜陵到池州石台汽车 长安汽车站到常平火车站 荣县至成都汽车时刻表 慈溪到嘉善西塘的汽车 慈溪到嘉善汽车 厦门到同安汽车站 常州机场到常州汽车站 宁波汽车南站临时站 中牟汽车站 沈阳汽车站订票 慈溪到嘉善西塘的汽车 长安汽车站到常平火车站 重庆菜园坝到合江汽车时刻表 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 重返1982开启暴富人生 十方境灭 全民御兽,我的宠兽能加点 从矿奴开始,万族称尊 灭道一剑 欧博官网 亚星管理平台 澳门葡京游戏官网 欧博官网 亚星游戏官网 慈溪到嘉善西塘的汽车 常州机场到常州汽车站 金华汽车南站到永康汽车时刻表 湖州到上海的汽车要多久 长安汽车站到常平火车站 绍兴北站到宁波汽车 三台到中江汽车 慈溪到嘉善汽车 盐城到无锡汽车几个小时 深圳市蛇口沃尔玛到罗湖汽车站坐的士多少钱 盐城到无锡汽车几个小时 泗洪汽车 杭州至桐乡汽车 萍乡到吉安汽车 荣县至成都汽车时刻表 常州机场到常州汽车站 郴州到柳州的汽车 长安汽车站到常平火车站 绵阳到都江堰汽车时刻表 中牟汽车站 宁波汽车南站临时站 金华到巍山汽车 沈阳汽车站订票 深圳市蛇口沃尔玛到罗湖汽车站坐的士多少钱 三台到中江汽车 荣县至成都汽车时刻表 金华到巍山汽车 郴州到柳州的汽车 荣县至成都汽车时刻表 义乌到嵊州汽车时刻表