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
狗狗能搽爽身粉吗?狗狗呕吐拉水吃什么药好狗狗能吃水煮西兰花么狗狗能喝大米稀饭吗狗狗能进的公共场合狗狗能搽爽身粉吗?狗狗尿液乳白色液体怎么回事狗狗能吃水煮西兰花么狗狗呕吐拉水吃什么食物好狗狗尿道口滴血狗狗尿不湿包装袋狗狗能搽爽身粉吗?狗狗尿液成白色狗狗尿不湿包装袋狗狗能吃水煮西兰花么狗狗尿道口滴血狗狗牛肉怎么煮狗狗能进的公共场合狗狗能进的公共场合狗狗排卵排几天结束狗狗呕吐拉水吃什么药狗狗能用护发素洗澡吗狗狗呕吐拉水吃什么狗狗排队领狗粮的照片狗狗尿红色后能喝水狗狗能测过敏源吗狗狗尿道口滴血狗狗能吃水煮西兰花么狗狗能喝什么汤狗狗呕吐拉水吃什么食物好黄墚一梦终须醒,无根无极本归尘。 金龙飞天归何处,不如凡间做真人。 最终章将梦醒作为结局,人生如戏,南柯一梦。混沌初开,孕分时空; 天地恒之,乃成世界。 三千小为中,三千中为大; 三千大世界,方得一宇宙; 宇宙无垠,混沌之始。 …… 天书录仙魔,地书鉴人妖; 无量诸世法,乾坤万物宝。 ...... 凡人问仙,谱写天地一个顶尖的剑客,为情遭人陷害,武功禁失,力经千难万险,恢复自己的功夫。 一个失了忆的刀客,初入江湖,想找回记忆,可是江湖险恶让想找回失忆的刀客受尽艰辛苦难。 这样奇葩的一刀一剑相遇了,他们会在江湖中刀歌剑舞着自己的故事或许有一天,当你踮起脚尖的时候,你会发现世界都变得广阔了一些。现代都市和平生活并未持续多久。当平行的世界被人们挖掘到信息,位面重叠,世界重启。这里变成了修行者的世界。无尽的尸海,广阔的荒漠,万族林立,百家争霸,无情的杀戮将一切虚幻斩断,而何处才是人类栖息之地?被迫害的李只能带着一对B去打NBA, 本来只想混两年就买只球队当老板, 没想到阴差阳错, 居然混到了总冠军。提瓦特大陆是一个有着七神统冶的七个国度,但换来这一切和平的,也正是二千年前的一场魔神大战。七神和创世神辰一起打败了魔神,换来了所谓的和平。而随着旅行者的到来,创世神辰的二十一条预言也慢慢开始服出水面。提瓦特大陆将再一次面临一场大的阴谋。 提前知道,三年后,末日降临异兽入侵。 身为乡村教师的秦风觉醒遮天修仙法。 开始带领全村族人一起修仙,准备抵御三年后的末日。 “表姐赶紧辞职把回来和我修仙。” “表哥你还要考研,还考个屁呀,赶紧回村修仙。” “城里房子赶紧卖了吧,修仙才是唯一正道。” 要问修仙哪家强,快去村里找秦风。 别人修仙我变强,吃吃喝喝变神王。 “您的族人已突破神桥境,反馈宿主获得百倍修为!” “您的族人已突破神王境,反馈宿主获得大道圣体!” “您的族人已突破准帝,反馈宿主获得极道帝兵!” …… 一个穷小子,机缘巧合下的一次重生,让他有了重新改变命运和环境的机会,面对家徒四壁负债累累的家庭,面对那个偏僻的小山沟,他一改过去的作风,踏实勤奋,刻苦拼搏,不但让自己和家人过上了受人尊敬的生活,而且,他还积极帮助乡亲,让一个外面闻所未闻的小山沟成为闻名遐迩的富裕之地,最终他的事业走向全国,冲向世界。我本是剑道门派一名不起眼的弟子,一次机缘巧合下得到了一根笛子,那一天一切都变了……
小白幻想曲 不死之身,等我 冒牌神语者 震惊!我发弹幕吓退了百万凶灵! 娱乐:这明星能处,有钱他真捐 大帝的脚是真的臭 命征英雄传说 这个世界不正经 江湖锦衣卫 尘封游 星际:炎黄崛起 破凡经 三界,无界之地灵传说 我有一百零八个学姐 百厄除尽我都市最强捉妖人 大梦轮回穿越 末日世界之异能觉醒 严舆列传 云征九天 英雄无敌之乱世幻想 狗狗呕吐拉水吃什么药好得快 狗狗尿道口滴血 狗狗牛肉怎么煮 狗狗能进的公共场合 狗狗呕吐拉水吃什么药好得快 狗狗趴地上睡会感冒么 狗狗呕吐 肚子还咕咕叫 狗狗尿红色后能喝水 狗狗偶尔吐痰怎么治疗 狗狗尿液成白色 狗狗呕吐拉水吃什么 狗狗呕吐拉水吃什么 狗狗排队领狗粮的照片 狗狗尿道口滴血 狗狗能搽爽身粉吗? 狗狗能喝什么汤 狗狗呕吐拉虫子 狗狗偶尔吐痰怎么治疗 狗狗呕吐拉水吃什么药好 狗狗能搽爽身粉吗? 狗狗尿道结石安乐死 狗狗能吃水煮西兰花么 狗狗呕吐拉水吃什么药好 狗狗能用护发素洗澡吗 狗狗尿红色后能喝水 狗狗排队领狗粮的照片 狗狗偶尔吐痰怎么治疗 狗狗呕吐拉水吃什么药好 狗狗呕吐拉水吃什么药 狗狗偶尔吐痰怎么治疗 狗狗能进的公共场合 狗狗尿道结石安乐死 狗狗能喝大米稀饭吗 狗狗能搽爽身粉吗? 狗狗排队领狗粮的照片 狗狗能喝什么汤 狗狗能打头部吗 狗狗呕吐 肚子还咕咕叫 狗狗排队领狗粮的照片 狗狗能打头部吗 狗狗能喝什么汤 狗狗尿黄吐了 狗狗排卵排几天结束 狗狗呕吐拉虫子 狗狗尿不湿包装袋 狗狗尿道结石安乐死 狗狗呕吐拉水吃什么 狗狗能喝什么汤 狗狗排卵排几天? 狗狗尿液乳白色液体怎么回事 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 口又忄昔 平民异能者 风语有经年 穿越,人在征途 幽冥大学流氓兔 百家乐官网 澳门葡京官网 葡京官网 百家乐官网 万利游戏官网 狗狗能喝什么汤 狗狗呕吐拉水吃什么药 狗狗呕吐拉水吃什么药 狗狗能用护发素洗澡吗 狗狗尿不湿包装袋 狗狗能喝大米稀饭吗 狗狗能喝什么汤 狗狗尿道结石安乐死 狗狗尿红色后能喝水 狗狗牛肉怎么煮 狗狗排队领狗粮的照片 狗狗能打头部吗 狗狗呕吐拉水吃什么药好得快 狗狗排卵排几天结束 狗狗呕吐拉水吃什么食物好 狗狗能喝什么汤 狗狗拍个气管片 狗狗尿黄吐了 狗狗尿黄吐了 狗狗能用护发素洗澡吗 狗狗能用护发素洗澡吗 狗狗能打头部吗 狗狗能喝大米稀饭吗 狗狗能测过敏源吗 狗狗尿红色后能喝水 狗狗牛肉怎么煮 狗狗拍个气管片 狗狗能吃水煮西兰花么 狗狗呕吐拉水吃什么药好 狗狗排卵排几天?