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
去驾校体检到哪里好曲阜驾校的分点可靠吗去牙克石铁马驾校练车全国驾校统一考试全国驾校统一考试成绩查询网站去驾校体检到哪里好仁怀驾校属于什么镇?去牙克石铁马驾校练车日照运总驾校班车路线图泉州驾校怎么投诉全通驾校怎么扣费去牙克石铁马驾校练车仁怀驾校怎么样全通驾校怎么扣费全国驾校发生安全事故泉州驾校怎么投诉日本驾校 换证全国驾校统一考试成绩查询系统全国驾校统一考试成绩查询系统去驾校体检到哪里丘北那个驾校拿证快点全国驾校统一考试成绩查询系统日照运总驾校班车路线图取消阳山驾校阳山费可退全国驾校统一考试成绩查询衢州驾校怎么收费全国驾校统一考试成绩查询取消阳山驾校阳山费可退去驾校体检到哪里仁怀驾校怎么样每个人都做过一些不同寻常的梦,而梦中总会让人觉得毛骨悚然,以至于成为童年的阴影,为什么会出现这样的故事,也许在冥冥之中,有的人正身处其中,而你的灵魂却触碰到了另一个世界的黑暗,所以有的东西,应该睡醒了就忘记……此书摘自于人类的睡梦。这里,现实与虚幻的分界点,而外边,是逐渐笼罩的黑暗。 你们这群疯子,都想探寻真相是吧?那就去吧,真相藏在外边,藏在历史和迷雾中!平行世界恐怖游戏降临,全人类笼罩在阴霾之中,苏毅穿越平行大陆,召唤九大鬼王,狂推各类副本。 笔仙:苏毅真的狗,跟几只鬼王把我通灵出来,笔被他折断,换成了电笔。 贞子:我正从电视往外爬呢,苏毅的鬼王就把我电给拔了,卡在电视当间不说,愣生生扯着头发将我拽了出来。 湘西铜甲尸:苏毅非说我身上的是古董,把我铜甲扒了,要上交国家! 苏毅通关了副本榜所有高难度副本,自此副本里的鬼物抱团取暖。 “坚持下来,活下去!”红月当空,全球骤变。拥有力量,你就高高在上,应有尽有,没有力量,你就只能任人宰割。危机爆发,众种族林立,丧尸,异兽,鬼种,人类。九转山河,浩瀚天下,试问天下,谁与争锋!起步比别人晚的颜逸能否追赶众人的脚步,在末日之中杀出一条属于自己的路。  李乘风穿越到一个妖魔横行的世界,成为青城山的一个守山人。   奈何他没有灵根无法修炼,只能安安分分做一个普通人。   但是有一天,他的系统突然变异了,从此成了一个令一众妖魔闻风丧胆的得道高人……   这妖怪也太弱了,我都没有出剑呢,怎么就死了。   我养的一条狗,居然是横扫妖界的一方妖王。   我池塘里的乌龟,竟然蜕变成了洪荒神兽。   之前跟我下棋的老头子,最后竟然成仙了。   还有那个最喜欢听他吟诗作对的漂亮姐姐居然修仙界第?仙?。   知道这些真相之后,李乘风开始怀疑人生:   我该不会真成为绝世高手了吧? 此身合该诗人未?细雨骑驴入剑门! 张霆玉意外穿越修仙世界,怎堪碌碌一生,做个凡人? 入剑门,得传承,竟成剑门老祖,忽悠他人就变强。 谁言仙路崎岖,长生漫漫? 修仙原来这么简单!2009年到2021年间,g城作为改革开放后迅速崛起的沿海城市之一,政治经济快速发展,商界奇才、慈善大家、教育大亨······齐聚在g城,由此展开一场场腥风血雨的争斗······ 你想过共享睡眠么?你想过你睡不醒的时候,把别人的睡眠共享给你么?你想过你无所事事,靠睡觉就能赚钱么? 你只听说过躺平赚钱,可真有这样的工作么? 一位生于盗墓世家的寻风与一位学霸张朵儿在校园以及历险中会擦出怎样的火花?历险的过程中会发生什么?敬请期待——闻墓录天地不仁,以万物为刍狗;帝王封建,以百姓为刍狗…… 在人类历史伟大的祭坛之上,满是殉难者了无生气的空壳;生命之火早已弃之而去,短暂的辉煌之后便是永久的沉寂…… 这,就是刍狗的宿命,千百年来从未改变…… 如果有一股不知名的力量萃聚进而复活所有星星点点的余烬,那么这份光芒可否感染幽暗无垠的苍穹…… 于是,这一刻终于到来了……
帝王医婿 我拯救了无敌救世主 异星生存之制霸宇宙 重生之探索苍罗大地的边界 无妄变 哀须臾 何为妖魔 江左之盟 重生,校园时代 仙途星辰 地表最强高手 神域天魂师 诸神将临:我有斩神模拟器 定世不朽 万里山河皆尘土 仙帝争锋 那夜月明 战婿狂医 我在东京经营宠物店 蓝蝶恋 去驾校体检到哪里好 日本驾校 换证 曲周县驾校有几家 仁怀驾校怎么样 曲周县驾校有几家 取消驾校驾驶证档案 日本驾校 换证 泉州驾校怎么投诉电话 衢州驾校怎么收费 仁怀驾校联系方式 日照运总驾校班车路线 日照运总驾校班车路线 去合肥万锦驾校总部 泉州鸿铭驾校退费 去驾校体检到哪里好 全国驾校统一考试成绩查询网站 日照浩通驾校考试预约 衢州驾校怎么收费 曲阜保安驾校科三地点 去牙克石铁马驾校练车 泉州鸿铭驾校退费 去牙克石铁马驾校练车 曲阜保安驾校科三地点 全国驾校统一考试成绩查询系统 泉州驾校怎么投诉 去合肥万锦驾校总部 曲周县驾校有几家 曲阜驾校的分点可靠吗 曲阜保安驾校科三地点 衢州驾校怎么收费 全国驾校统一考试成绩查询网站 泉州鸿铭驾校电话多少 全国驾校统一考试 去驾校体检到哪里好 取消阳山驾校阳山费可退 全国驾校统一考试成绩查询 全国驾校统一考试 日本驾校 换证 去合肥万锦驾校总部 全国驾校发生安全事故 全国驾校统一考试成绩查询 泉州驾校怎么投诉电话 去驾校体检到哪里便宜 日照浩通驾校考试预约 全通驾校怎么扣费 泉州鸿铭驾校电话多少 日照运总驾校班车路线 全国驾校统一考试成绩查询 去合肥万锦驾校总部 仁怀哪个驾校好一点 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 春秋战国历史演义 无缺的道 海贼之无敌后才开始签到 大荒祖龙诀 这江湖有点不对劲 欧博官网 亚星官网 万利游戏官网 欧博官网 澳门葡京游戏官网 泉州驾校怎么投诉 全国驾校发生安全事故 曲阜保安驾校科三地点 取消驾校驾驶证档案 泉州驾校怎么投诉电话 全国驾校统一考试成绩查询网站 全国驾校统一考试 日本驾校 换证 全国驾校统一考试成绩查询 全通驾校怎么扣费 仁怀哪个驾校好一点 泉州鸿铭驾校电话多少 去合肥万锦驾校总部 泉州驾校怎么投诉 日照运总驾校班车路线图 曲阜驾校的分点可靠吗 丘北那个驾校拿证快点 仁怀驾校怎么样 去牙克石铁马驾校练车 仁怀驾校怎么样 曲阜保安驾校科三地点 仁怀哪个驾校好一点 仁怀驾校怎么样 去合肥万锦驾校总部 仁怀驾校属于什么镇? 日照运总驾校班车路线 取消驾校驾驶证档案 日照运总驾校班车路线 泉州鸿铭驾校电话多少 丘北那个驾校拿证快点