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
湖北黄石团城山申通快递电话湖南长沙岳麓区中通快递的电话湖北省 恩施中通快递电话湖北十堰郧西顺丰快递电话号码湖北蔡甸百世快递分部的电话湖北黄石团城山申通快递电话湖南长沙国通快递网点查询电话湖北省 恩施中通快递电话湖南长沙开福区快捷快递电话湖北通城邮政快递电话湖南长沙芙蓉区国通电话湖北省 恩施中通快递电话湖南长沙国通快递电话号码湖南长沙芙蓉区国通电话湖北十堰郧西顺丰快递电话湖北通城邮政快递电话湖北竹山邮政快递电话湖北十堰市百世快递电话湖北蔡甸百世快递分部的电话湖北谷城县百世快运电话湖南长沙雨花区快捷快递电话湖北十堰市百世快递电话湖南长沙开福区快捷快递电话湖南邵阳百世汇通快递电话呼市邮政平邮电话湖南长沙申通步步高分部电话呼市邮政平邮电话湖南邵阳百世汇通快递电话湖北谷城县百世快运电话湖南长沙国通快递电话号码 如果除去天生阴阳眼的话,我的前半生应该是普通的不能再普通了,但自从那天之后,我墨色的生活被染上了色彩。 来自数百年后的特种兵王,穿越成为和自己名字同音的晚明皇帝天启身上。 狙建奴,收日韩,木匠皇帝?不,工匠皇帝!大国工业自明而始! 铁血皇明,平推世界!古之大能者,无不是有天地之大道气运加持于身。 我有一堆古之大能加持于身。 菊花受创,开启无敌之路。有那么一类人天生就是王侯将相的命,他们一人之下万人之上,享受着翻云覆雨的快感,殊不知,在他们头顶,还有一顶帽子将他们死死扣着,这顶帽子上面就只有一个字:皇。 红尘俗世,纸醉金迷,当一位潜心修道的少年踏入其中时,又会发生什么样的奇缘?踏着尸骨累累的道路走来,完成成为皇者的征途。他,注定是成为皇的男人! 求订阅!求票! PS:这本书不会太监,长歌会坚持写完,就算没人看也一样!“极数在九”,九皇子云辞一把&amp;quot;沉浮剑&amp;quot;在手。年少时的梦想是如父王一般成为万世瞩目的帝皇,让天下臣服,让百姓安居乐业,让云皇朝的国旗飘满世界八荒。 皇子正式踏入修炼,在修武路上,自成一脉,开宗立派,成为帝王统一云左大陆,开战场,战鬼族,抓蛮兽…… 统一人族,带领云左大陆忠心耿耿的部下一起封神....... 在成帝这条路上,他没有辜负任何人,唯独对不起左蓉一人。 有的时候都在怀疑自己是对是错,可是这是我年少时的梦想啊……宋帝都临安府爱国人士:吴俊振,与用时光机穿越过来的现代大学生:马维,两人一起被龙卷风漩涡黑洞带着,穿越到了明崇祯十六年公元1643年兴都留守司显陵卫境内,在机缘巧合之下他们俩主动应征入伍参军,从此开启一段帮助大明帝国收复失地的旅程,本文群号799968110楚阳,本来是古代武林高手,飞檐走壁,力大如牛,精通点穴。穿越到现代都市,成了一个一无所知、一无所有的小白,幸好得一众美女相助——高三少女,商贩女儿,飒爽警花,美女骑手,高冷女总,温柔护士,冷酷杀手……陈阳穿越到了高武世界,获得了一个能查看人生剧本的系统! 这人生剧本,能预知人未来,查看命格,甚至连对方的最近机缘都一目了然! “绝世机遇!?不好意思,我先收为敬!” 三流的主角等机缘。 二流的主角找机缘! 而陈阳:机缘在哪,我就在哪! 林田获得随身空间种田,春花秋月,悠然南山,坐吃山不空。 他只想过好自己的小日子,实力却不允许他低调。 什么是钱?什么是美女?呵。 当灵果风靡全世界,人人求之不得之时,灵果制造商躺在摇椅上悠然撸猫,岁月静好。 然而,当危机降临到他在乎的人身上,要战,便战! 这是一个全球灾变数千年后的世界。 在这里,每个人都可以召唤来自异世界的存在进行战斗。 而穿越到这个世界的白夜,激活了成就系统,召唤出了异界最强的元素精灵! ”震惊:天才召唤师初始召唤竟然是精灵!“ ”不可思议!饱受整个学院希望的天才,竟然一朝成了废物!“ ”她太白太嫩,根本就每办法战斗!“ 一时间,所有人都在纷纷议论,没有一人看好白夜。 而作为穿越者的白夜表示: ”对于元素精灵的力量,你们一无所知!“
权权之心 战风新纪元:央隆比亚 吉天记 我!狂神 不以玄界 我只想猥琐发育! 大国妙医 纯屌丝逆袭 死亡回忆博物馆 异界牛马 成为勇者 超能力的我才不会被她威胁 毁坏的三观 星界纪元 大明剑侠风云录 明日方舟之穿越 其实我也不想穿越的 万世灵冢 我的宠物是大佬 持剑定乾坤 湖南长沙上河国际分部申通快递电话号码 湖北省随州市ems电话 湖北竹山邮政快递电话 湖北蔡甸百世快递分部的电话 湖南长沙上河国际分部申通快递电话号码 湖南邵阳百世汇通查询电话 湖北竹山邮政快递电话 湖南长沙国通快递电话 湖南长沙申通步步高分部电话 湖南长沙国通快递电话查询 湖南长沙开福区百世快递电话号码 湖南长沙开福区百世快递电话号码 湖北麻城中通速递客服电话 湖北省随州市ems电话 湖北黄石团城山申通快递电话 湖北蔡甸百世快递分部的电话 湖北竹山邮政快递电话号码 湖南长沙上河国际分部申通快递电话号码 湖南长沙雨花区快捷快递电话号码 湖北省 恩施中通快递电话 湖北省随州市ems电话 湖北省 恩施中通快递电话 湖南长沙雨花区快捷快递电话号码 湖北十堰市百世快递电话 湖北通城邮政快递电话 湖北麻城中通速递客服电话 湖南长沙上河国际分部申通快递电话号码 湖南长沙岳麓区中通快递的电话 湖南长沙雨花区快捷快递电话号码 湖南长沙申通步步高分部电话 湖北蔡甸百世快递分部的电话 湖北省十堰市房县圆通快递电话 湖北十堰郧西顺丰快递电话号码 湖北黄石团城山申通快递电话 湖南邵阳百世汇通快递电话 呼市邮政平邮电话 湖北十堰郧西顺丰快递电话号码 湖北竹山邮政快递电话 湖南邵阳百世汇通快递电话 湖北十堰郧西顺丰快递电话 呼市邮政平邮电话 湖南长沙国通快递电话 湖北谷城县百世快运电话号码 湖北竹山邮政快递电话号码 湖南长沙芙蓉区国通电话 湖北省十堰市房县圆通快递电话 湖南长沙开福区百世快递电话号码 呼市邮政平邮电话 湖北麻城中通速递客服电话 湖南长沙开福区百世快递电话 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星游戏官网 侵略者0126 我在原始社会发展现代文明 威服四海 苍穹永生 血色苍风 皇冠登3出租 亚星管理平台 澳门葡京官网 皇冠登3出租 亚星官网 湖北竹山邮政快递电话号码 湖北黄石团城山申通快递电话 湖北省随州市ems电话 湖南长沙国通快递电话 湖北通城邮政快递电话 湖北十堰郧西顺丰快递电话 湖南长沙雨花区快捷快递电话号码 湖南邵阳百世汇通查询电话 湖北十堰郧西顺丰快递电话号码 湖北蔡甸百世快递分部的电话 湖北十堰郧西顺丰快递电话号码 湖北竹山邮政快递电话 呼市邮政平邮电话 湖南长沙芙蓉区国通电话 湖南长沙芙蓉区国通电话 湖北黄石团城山申通快递电话 湖北麻城中通速递客服电话 湖北通城邮政快递电话 湖南长沙开福区快捷快递电话 湖南长沙雨花区快捷快递电话号码 湖南长沙雨花区快捷快递电话 湖南长沙国通快递电话查询 湖北省 恩施中通快递电话 湖北蔡甸百世快递分部的电话 湖南长沙国通快递电话号码 湖南长沙开福区百世快递电话 湖南长沙国通快递电话号码 湖南邵阳百世汇通快递电话 湖南长沙国通快递网点查询电话 湖南长沙开福区百世快递电话号码