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
邮票背面是什么意思2017年8月新邮票预告邮票 黛玉 出自三国邮票一共几组刘海栗邮票大版我国邮票发行97阅兵纪念邮票邮票 黛玉 出自2009邮电局纪念邮票邮票又被称什么意思是什么意思桃花坞邮票多少钱邮票背面是什么意思武术 邮票 价格特24邮票价格及图片及价格表邮票 黛玉 出自邮票又被称什么意思是什么意思2016年火猴生肖邮票85年的邮票年册85年的邮票年册网上龙文物邮票大版千里江山图邮票设计85年的邮票年册2009邮电局纪念邮票邮票纪4的价格刘海栗邮票大版杭州邮票展览三国邮票一共几组邮票纪4的价格香港回归20周年大版邮票价格查询武术 邮票 价格XX年间,天下大乱,群妖四起,官兵横行,百姓民不聊生。 天上众神,心疼百姓,特派紫微星下界,斩妖除魔,匡扶正义,救黎明于水火。 紫微星领命,下到人间,化身一名女子,隐居山间,观察人间百态,看遍民间疾苦,可悲可叹!“雷雨天,别进山” 山野小镇的少年余樊,一直谨记父亲临终前的忠告,当一个安分守己的猎户。 他从未想过小镇外面的世界是什么样子,只想守着母亲,长大以后讨房媳妇,像祖祖辈辈一样繁衍后代,生生不息。 直到有一天,小镇来几个陌生的“仙人”。 雷声起时,少年终于还是进了山,从此走上了一条注定无法停下脚步的长生路。 “师傅,时代变了!隔壁王二麻子都去做直播了,还赚的盆满钵满!我们算命的也要与时俱进啊!”叶白内心不断劝慰着已故的师傅,实际却是给自己找理由。 “大师,你算得准不准啊?怕不是江湖骗子吧!”网友质疑道。 叶白看着屏幕说道:“什么?你说我算得不准?那我告诉你,你老婆屁股上有颗痣!!!” 该网友当场暴走,顺着网线就要过来砍死叶白。 “这位朋友,你先别激动,我说这是我算出来的,你信不信???” ...... 叶白随手画出一道符箓,就能治病救人。 然而嘴里却劝说道:“朋友们,我们要相信科学!!!” 游戏与考试有时可以实现完美结合,而道德也应该影响考试的结果,某个班级里的十五名男生也这么想。他们个个都在某些领域有着自己的专长,也有着自己致命的缺陷。他们有的出身显赫,父母都热爱读书;有的却不幸出身于一个思想境界低下的家庭,不慎被家庭影响,坠入无底深渊。突然,他们被卷入了一场场特殊的考试之中,他们需要用自己学过的知识去应对各种各样的险境。你认为他们能成功吗?黑夜来临,游戏开始。刚飞升就被打落凡间,要不要这么惨啊? 诶,大家都落入凡尘了啊?那没事了...李道远意外穿越小说世界,竟成为小说前期反派富二代他爹。 此时,他的废柴儿子已经招惹到了小说的天命主角,马上就要将整个家族带进沟里。 李道远想要从根源上改变命运已经来不及。 就在李道远无语问苍天,准备放弃治疗时,【至尊反派系统】激活了。 只要打击主角,抢夺主角的机缘,都会获得相应的反派点与气运值。 于是乎,一位用自己儿子开始钓鱼执法的慈父正式上线。 “我的儿子只有我能打,别人打我儿子,那我就废了他!” 我快死了。   马上我就可以永远的长眠了。 这是一个少年在临终前的想法。但是他不知道,活着得干活死了也得干活。不尊重生命之人,将会获得乘法,获得永生成为死神,永远看着生命在临终之时痛苦的模样。 少年本已疲惫,以为终于可以永远的享受宁静,结果怎么也没想到自尽了断之后,居然成为了死神,还得继续工作。回收灵魂确认死亡名单,筛选能够成为引领人类的人,并让他继续活下去,去捕捉在世间游荡的冤魂以及伤害人类勾引人类在人类的耳边轻语的恶魔。死神的工作很多呢 当修真者穿越到了现代,因为语言不通闹出了许多笑话。 谁能想到,一个不起眼学生竟然是修真界的最强者? 最强S级异能者?对不起,只需要一剑。 异能者和修真者的碰撞,核武和仙术的对轰…… 重回大唐贞观年间,来到了文昌武盛,民族自豪感最强的朝代,看李桂豫如何让大唐变得更强大。
赛博朋克的最强跟班 如来密码 飞升从家族修仙开始 末世城下之钢铁洪流 俯身瞰周天 擎天道门 灌水之王,发呆专用 他们在干什么集 错剑风云 元素宠师 七步神灵 这个魔方不太普通 末法封魔人 疯狂的病号 长平记 绝世杏林 此事古难全 我永生不灭 捉鬼召唤师 光明暗裔 邮票的画是谁画的 2017年文物邮票 2016年火猴生肖邮票 85年的邮票年册 邮票的画是谁画的 批林批孔邮票估值 2017年10月发行邮票 1991年20分牡丹邮票 杭州邮票展览 武术 邮票 价格 2009邮电局纪念邮票 2006丝绸文房四宝邮票 古钱币邮票图片及价格 邮票又被称什么意思是什么意思 我国邮票发行 刘海栗邮票大版 2017年10月发行邮票 杭州邮票展览 千里江山图邮票设计 邮票背面是什么意思 2017年文物邮票 邮票 黛玉 出自 2017年8月新邮票预告 特24邮票价格及图片及价格表 邮票又被称什么意思是什么意思 古钱币邮票图片及价格 杭州邮票展览 2017年8月新邮票预告 千里江山图邮票设计 杭州邮票展览 刘海栗邮票大版 2017年文物邮票 邮票背面是什么 邮票背面是什么意思 邮票纪4的价格 刘海栗邮票大版 邮票背面是什么 2016年火猴生肖邮票 古钱币邮票图片及价格 邮票 黛玉 出自 三国邮票一共几组 1994年紫砂壶邮票价格 网上龙文物邮票大版 2006丝绸文房四宝邮票 特24邮票价格及图片及价格表 2017年文物邮票 2006丝绸文房四宝邮票 三国邮票一共几组 香港回归20周年大版邮票价格查询 97阅兵纪念邮票 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 炼天剑神 十年的失却 星玉圣师 生死鬼瞳 心岛穿梭 葡京官网 快连下载 欧博官网 葡京官网 欧博官网 钱币邮票文化 千里江山图邮票设计 钱币邮票文化 1994年紫砂壶邮票价格 2016年火猴生肖邮票 邮票背面是什么 85年的邮票年册 刘海栗邮票大版 2009邮电局纪念邮票 97阅兵纪念邮票 2009邮电局纪念邮票 香港回归20周年大版邮票价格查询 网上龙文物邮票大版 2009邮电局纪念邮票 1991年20分牡丹邮票 网上龙文物邮票大版 邮票 黛玉 出自 邮票背面是什么意思 杭州邮票展览 2017年8月新邮票预告 三国邮票一共几组 钱币邮票文化 2016年火猴生肖邮票 97阅兵纪念邮票 特24邮票价格及图片及价格表 邮票纪4的价格 我国邮票发行 桃花坞邮票多少钱 邮票又被称什么意思是什么意思 桃花坞邮票多少钱