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
郑州火车站101路公交石门到郴州火车票多少钱蒙自到昆明火车停靠点淄博货运火车时刻表惠州经过东莞东的火车时刻表郑州火车站101路公交镇远有火车直达吗蒙自到昆明火车停靠点汉中到南充火车票多钱固姓到绍兴火车票长春哈尔滨 火车郑州火车站101路公交兖州到贵阳坐火车怎样走长春哈尔滨 火车蒙自到昆明火车停靠点火车站 护照取票郑州深圳火车路线图惠州经过东莞东的火车时刻表惠州经过东莞东的火车时刻表杭州开往湖州火车票价杯化至三明火车长春到蓬莱火车怎么走汉中到南充火车票多钱硕放火车站有客运吗昆明至全州南的火车南京 兰州火车途径淄博货运火车时刻表益阳市到云南火车票杭州开往湖州火车票价白城至珲春火车时刻表一个小和尚,穿越到了异世界大陆,面对公主和女皇的挽留,他就只想着回家?天空突变,一次偶然的机会人类发现了比自己还强大的物种,贪婪的妄想却把沉睡千年的丧尸给惊醒了,不思考只听他人的人类征服选择了错误的选项差点毁掉世界,圣鹰小队能否侦破这起危机......彼时的少年已经站在了成长尽头,回首过去,一切崎岖早已繁花盛开。已然二十岁的我们会是青春,会是热血,会有一场拖拉机下山轰轰烈烈的恋爱.........而有些人的二十岁,会是迷茫,不知所措,也许,会是你我......二十年前,一场大火,父母双亡,与妹妹分离。 二十年后,接到刺杀任务,在战斗过程中,猜测目标是和自己分开了二十多年的妹妹。 因为这个猜测,导致任务失败,受到组织惩罚,“意外”死亡。 重生后,在成长路上,发现了二十年前的那场大火里,还隐藏着不为人知的秘密……打架其实并不是一件多华丽的事情,有的人三两下被打趴下就再也爬不起来了,根本不存在那种斗来斗去如同功夫切磋一般的场面。故事讲述钟馗后裔钟北含冤而亡化作厉鬼,因为魔神祖先背景成为架空时代大塘的一名“阴司判官”。因家传宝玉与一千年后的子孙主角钟南跨越时空产生联系,能够被钟南召唤上身,成为钟南的“金手指”,从此一人一鬼的生存轨迹彼此交织在了一起。钟南、钟北以古今两代的宝玉本体为媒介,钟南帮助钟北在大塘斩妖除鬼、拨正乾坤。钟北帮助钟南在现代社会成就事业、匡扶正义。从此鬼成了英雄,人成了枭雄。古今两世看主角如此翻天覆地……侠,以武犯禁。 魔,以欲乱世。 当一个力量与技巧都达到极致的存在出现在这个世界上时是怎样的体验? 这是一个杀戮机器逐渐成长为人的故事....武道之途,乃与天争命,逆天而行,遭天罚万劫。世间唯有九脉者,脉与天合,顺天而行,身怀天地气运,迎劫渡身,逢凶化吉。 林辰本乃天赋异禀,为天纵骄子,修途一路高歌,遍处风光。因缘偶得奇功妙诀,断脉重修。从此遭同门羞耻,宗门遗弃,兄弟背叛,处遭唾弃。 待我重回巅峰,问鼎苍穹,势必一洗前耻,傲世凌天。当黑暗侵袭,有人跪下,有人放弃。 而我们,会鲜血流尽,战斗到底。 而我,就是这诸天万界的主!
异界人才 火凤凰签到三年,成为特战兵王 岩门村的传说,龙英的传说 一定不会放过你 我是天道编程员 御兽:宝可梦纵横世界 永世天殇之帝君诞生 圣元魔尊 行于天灾间,我能做什么 永恒帝师 诡道志异 系统,系统! 风影之主 江左之盟 苍天龙猫 剑,逍遥 诸天:开局忽悠李白开饭店 隐忧悄悄 闵荒 我家婢女有点凶 南京 兰州火车途径 火车站 护照取票 郑州深圳火车路线图 惠州经过东莞东的火车时刻表 石门到郴州火车票多少钱 益阳市到云南火车票 万源有火车站 姜堰到无锡火车站的公交 锦州到彰武火车时刻 兖州到贵阳坐火车怎样走 威海-宜昌火车车次 威海-宜昌火车车次 硕放火车站有客运吗 火车站 护照取票 郑州火车站101路公交 昆明至全州南的火车 邢台到南昌的火车硬卧价钱 南京 兰州火车途径 辽阳到大连火车卧铺 蒙自到昆明火车停靠点 天门市火车时刻表 蒙自到昆明火车停靠点 辽阳到大连火车卧铺 长春到蓬莱火车怎么走 固姓到绍兴火车票 义乌到诸暨在火车站 南京 兰州火车途径 辽阳到大连火车卧铺 杯化至三明火车 南京 兰州火车途径 惠州经过东莞东的火车时刻表 天门市火车时刻表 淄博货运火车时刻表 郑州火车站101路公交 硕放火车站有客运吗 昆明至全州南的火车 淄博货运火车时刻表 万源有火车站 硕放火车站有客运吗 聊城东火车站时刻表 昆明至全州南的火车 姜堰到无锡火车站的公交 杭州开往湖州火车票价 邢台到南昌的火车硬卧价钱 长春哈尔滨 火车 天门市火车时刻表 威海-宜昌火车车次 昆明至全州南的火车 义乌到诸暨在火车站 郑州深圳火车路线图 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 玄皇归来 群雄之大齐帝国 重生1992 末日生存之我的机器人军团 天界重生异能者 葡京官网 欧博官网 亚星管理平台 万利官网 欧博官网 姜堰到无锡火车站的公交 淄博货运火车时刻表 辽阳到大连火车卧铺 益阳市到云南火车票 兖州到贵阳坐火车怎样走 惠州经过东莞东的火车时刻表 昆明至全州南的火车 邢台到南昌的火车硬卧价钱 惠州经过东莞东的火车时刻表 锦州到彰武火车时刻 聊城东火车站时刻表 锦州到彰武火车时刻 镇远有火车直达吗 义乌到诸暨在火车站 长春到蓬莱火车怎么走 天门市火车时刻表 长春哈尔滨 火车 沈阳扬州火车时刻表查询系统 威海-宜昌火车车次 郑州火车站101路公交 天门市火车时刻表 聊城东火车站时刻表 郑州火车站101路公交 白城至珲春火车时刻表 蒙自到昆明火车停靠点 昆明至全州南的火车 兖州到贵阳坐火车怎样走 惠州经过东莞东的火车时刻表 锦州到彰武火车时刻 长春哈尔滨 火车