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
小说 品色武道仙影 神秘道人 小说玲珑木 小说女主角是男主角姐姐男主角爱上姐姐其中一个男主叫莲花的校园小说太史慈 管亥 小说小说 品色天诛道灭 爱尚小说玲珑木 小说羽翼大明 小说重生洪荒成鱼 第七时空 小说仙遁 蛇吞鲸 小说玲珑木 小说武道丹尊 暗魔师 小说大神 网络小说弟控连七的??迳?活 满地繁华 小说重生洪荒成鱼 第七时空 小说如果青春多一点 四月尾巴 小说无限密室 无料的人 小说无限密室 无料的人 小说萌葩异人组 脱小线 小说无限星域 风吹发 小说无限密室 无料的人 小说羽翼大明 小说爱人好凶残 零望0空 小说太史慈 管亥 小说捍卫星空 能量猪 小说神临绝世唐门 临神之影 小说爱人好凶残 零望0空 小说萌葩异人组 脱小线 小说武道丹尊 暗魔师 小说深居野林神秘老道,一手培养出七位足矣撼动华夏的绝美女徒弟。今日,又一名最小男徒儿罗峰顺利出山。 罗峰:“我是老逼灯培养出最垃圾的徒弟,没什么本事,就想吃吃软饭,苟且度过这一生。” 师父:“什么,他说他最弱?难道我没有告诉过你们,那小子身怀诡秘?” 师姐:“我好像发现我们的小师弟越来越不对劲儿了,为什么世界各大强者都来跪舔他?” 一位来自于世界黑暗深处的顶级势力后裔之子,出生便被抛弃做弃子,偶遇华夏旧时代战力天花板老疯子和七位倾城倾国的大背景七位师姐,从此掌握七大绝学误入都市豪门,卷动江湖风云,走上自证强者之路。腾龙大陆。   万族林立,人以强者为尊。   而肖不易的身份却是反派,和主角王岩所对立的反派孑然一身的出租车司机孟一,“机缘巧合”之下认识了神秘的女人,又“无意间”牵扯进地府的斗争之中,废弃的酒店、神秘的鬼城、数不尽的鬼屋阴宅,一个又一个阴谋逐渐浮出水面。阴谋与阳谋,明争与暗斗,死亡究竟是结束还是开始。最诡异的是孟一发现,自己早已去世的双亲竟然也牵涉其中……【灵气复苏、异兽流、无女主、不圣母】 苏辰穿越成为了一只长臂猿,竟能看到属性面板和未来命数! 因得到了所有母猴芳心,引来猴群追杀…… 好在天降神雷,灵气复苏,群猴心性大乱,开始自相残杀。 嗯?这只猕猴未来能找到洗髓果? 你以为这是你的命中注定吗?错,被我看见,你的机遇就成我的了! 与此同时,灵气复苏之后,世界大变,无数野兽血脉觉醒! 几十米长的巨蟒,一口咬碎游轮的狂鲨,周身被火焰萦绕的狼王…… 更有沉睡之中山海经异兽,不断的苏醒! 千年之前,正邪大战,凌南修仙界势力大洗牌。千年之后,一个没落的小修仙世家,一个年轻的修士加入宗门,开始自己的崛起之路。天地奇珍,瑞兽异兽,玄秘功法,海阔凭鱼跃。维度破裂,世界重启 怪物的降临让人类束手无策 “我并不知道发生了什么,但如果是因为我的家人从而导致现在的一切我愿意用我的生命来弥补他们所犯下的过错”一条由个人博客发出的离婚吐槽,轰动世界。 开局被丈母娘嫌弃,被逼退婚..... 没想到,女婿竟是消失多年的昆仑战神。你瞧,那金銮殿中,哪一个不是食人妖魔?哪一个不是鬼祟魍魉?   你看,这各地界域、州府,哪一处不是修士势力的掌中物?   你听,这是天下百姓在临死前,发出的绝望哀嚎声。   李沐风望了望双手,还有身旁的剑。 当他拔剑时,这天下的不公、这妖魔与修士定下的条条框框,皆要化作飞灰!楚君玄一穿越,就遇到了神仙姐姐被人追杀,本以为会死,却被一块青玉所救…… 夺仙人之躯的楚君玄,随手一掏,就是仙家法宝;入住全是少女的秋水宫;与一众仙子、妖女打得火热;和李靖、秦叔宝、李淳风等大唐英豪们称兄道弟、斩妖除魔…… 妖魔两族来袭,人间经历大劫,七大妖王、八大魔头、九真五佛,高手如云,一场波澜壮阔的妖魔大战开启…… 生来记忆被封印,随着修为增加,记忆不断恢复,被封印的记忆即将打开,轮回一世是否战胜自己的哥哥
晴姐,等我的江山如画 无双! 玄武裂天 奶爸的异界幸福生活 开局表白百次,我绝不放弃 进化文明年编史 不灭之万古仙帝 崩坏美好世界现世行 望枫天地行 抗战之谍影重重 灵械至上 莫斯肯漩涡 三国昭昊传 穿越古代我让家族称霸一方 禁忌的存在 我有一只吞吞兽 四个游戏 特种兵之最强国术系统 那年杜鹃开正艳 白雨夜行 大神 网络小说 剑圣的小说 小说 品色 羽翼大明 小说 大神 网络小说 何处不安然 梦菲亚 小说 玲珑木 小说 喋血缅北 信周 小说 仙遁 蛇吞鲸 小说 暗恋小说 搞笑 女主角是男主角姐姐男主角爱上姐姐其中一个男主叫莲花的校园小说 弟控连七的??迳?活 满地繁华 小说 侠名小说 剑圣的小说 从戎小说 羽翼大明 小说 玲珑木 小说 仙遁 蛇吞鲸 小说 太史慈 管亥 小说 天诛道灭 爱尚小说 剑圣的小说 如果青春多一点 四月尾巴 小说 无限密室 无料的人 小说 男变女 轻小说 捍卫星空 能量猪 小说 侠名小说 仙遁 蛇吞鲸 小说 无限密室 无料的人 小说 太史慈 管亥 小说 捍卫星空 能量猪 小说 太史慈 管亥 小说 仙遁 蛇吞鲸 小说 女主角是男主角姐姐男主角爱上姐姐其中一个男主叫莲花的校园小说 小说 品色 爱人好凶残 零望0空 小说 太史慈 管亥 小说 女主角是男主角姐姐男主角爱上姐姐其中一个男主叫莲花的校园小说 如果青春多一点 四月尾巴 小说 暗恋小说 搞笑 弟控连七的??迳?活 满地繁华 小说 神临绝世唐门 临神之影 小说 虫纹小说 福临心至 小说 网王之惑然 残惑嗜魅 小说 大神 网络小说 何处不安然 梦菲亚 小说 有声小说 奋斗在初唐 神临绝世唐门 临神之影 小说 暗恋小说 搞笑 天诛道灭 爱尚小说 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 行尸走肉之百战神兵 大道之无恨 异界血刀行 隐忧悄悄 红楼:我在贾府带妹修仙 亚星官网 万利官网 欧博官网 亚星官网 AG真人 太史慈 管亥 小说 有声小说 奋斗在初唐 无限密室 无料的人 小说 何处不安然 梦菲亚 小说 网王之惑然 残惑嗜魅 小说 重生洪荒成鱼 第七时空 小说 大神 网络小说 虫纹小说 福临心至 小说 剑圣的小说 小说 品色 从戎小说 侠名小说 天诛道灭 爱尚小说 剑圣的小说 网王之惑然 残惑嗜魅 小说 天诛道灭 爱尚小说 无限密室 无料的人 小说 如果青春多一点 四月尾巴 小说 无限星域 风吹发 小说 暗恋小说 搞笑 无限星域 风吹发 小说 网王之惑然 残惑嗜魅 小说 武道仙影 神秘道人 小说 何处不安然 梦菲亚 小说 虫纹小说 重生洪荒成鱼 第七时空 小说 喋血缅北 信周 小说 小说 品色 神临绝世唐门 临神之影 小说