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
简单动物头像简笔画图片大全可爱图片关于牛的卡通头像男生头像亲吻手指的情侣头像图片掐女生脸蛋图片卡通头像清晰花头像图片下载简单动物头像简笔画图片大全可爱图片用狗狗做头像好吗亲吻手指的情侣头像图片权志龙头像卡通头像情侣头像男动漫动物头像情侣牵手头像动漫图片求求群头像图片大全女生情侣动漫超清头像用狗狗做头像好吗古风唯美手绘图片女生头像高清图片海边 书 头像图片唯美清新情侣伤感照片卡通头像带字图片大全用背影做头像的女生头像图片大全用背影做头像的女生头像图片大全古风图片伤感带字图片女生头像情侣头像一男一女黑白头像图片用背影做头像的女生头像图片大全情侣头像三个男头像大全血腥漫画人物图片头像女生头像简单卡通情侣头像 简约古风可爱头像真人头像简单卡通情侣头像 简约血腥漫画人物图片头像女生头像古风图片伤感带字图片女生头像情侣动漫超清头像救人一命胜造七级浮屠,美女施主,你我有缘啊...神明与人同存的世界,人类反抗神明的故事本来就只有一个平凡的一生,哪有那么多机遇让你改变自己的命运不知源头何处的神秘星球,在芸芸众生皆不曾反映之际,降临到了太阳系地外虚空,遮天蔽日,扰乱了时分。而钟挺原本平凡无奇的人生也发生了翻天覆地的变化,不得不一直逆天而行······ 大道为络,天地作星,众生如子。一场谁也逃不开的博弈就此展开。 叩仙门,觅神迹,自是横刀向天笑! 远古人类探索,揭秘古老遥远的史前世界!男主顺利步入大学,还沉浸在大学生活之中。可父母却在外的旅行中,一死一失踪,无意间,男主了解到父母的遭遇并不是意外,为了解开事情的真相男主走上了复仇之路……完结大梦一场,穿越到1987年; 一次车祸,梦魇中喝了忘忧水; 一只修罗手套,重生到五百年前; 古墓中激活了古龙珠,唤醒七色混沌葫芦,开启系统传奇之路; 十五万铁甲齐上阵,竟无一是男儿身; 心念起,万水千山~ 心念灭,沧海桑田~ 一念~可成众生~ 一念~可成天神~ 红尘砺剑心,沧海一笑间, 乾坤一剑平,万古啸青天, 笑傲宇宙巅,星空化自在~~大荒里不知名的小村子,几位少年从这里走出,开启属于他们的传奇人生。 黑暗中的幕后者从沉睡中苏醒,天地棋盘悄然展开,一切才刚刚浮出水面……修仙和历史共存,里面涉及的历史典故和俗语比较多。
斗破之天命神王 侵略者0126 天陨六星 宇宙第一武者 何老医传 铠甲勇士之宇宙危机 抱歉,这火我传不了 玄幻:赵高,一步一步往上 源之核 再无敌一次 在末日里当丧尸 走过平凡人生 风月实录一娇花 我真不是始皇帝啊 关于反抗军的那些故事 震惊,我的视频通未来! 西西里的烟火 今朝登天门 从蛇开始的进化 神医从妇科圣手开始 掐女生脸蛋图片卡通头像 权志龙头像卡通头像 情侣头像男动漫动物头像 用狗狗做头像好吗 掐女生脸蛋图片卡通头像 清晰花头像图片下载 情侣头像男动漫动物头像 情侣动漫超清头像 血腥漫画人物图片头像女生头像 关于牛的卡通头像男生头像 情侣头像一男一女黑白头像图片 情侣头像一男一女黑白头像图片 芽衣子男友头像 权志龙头像卡通头像 古风唯美手绘图片女生头像高清图片 用狗狗做头像好吗 情侣头像三个男头像大全 血腥漫画人物图片头像女生头像 亲吻手指的情侣头像图片 哈士奇的头像图片搞笑图片 权志龙头像卡通头像 哈士奇的头像图片搞笑图片 亲吻手指的情侣头像图片 优美小清新图片女生头像女生 古风唯美手绘图片女生头像高清图片 情侣头像三个男头像大全 情侣伤感照片卡通头像带字图片大全 关于牛的卡通头像男生头像 情侣动漫超清头像 情侣伤感照片卡通头像带字图片大全 清晰花头像图片下载 清新男生卡通头像图片大全可爱图片 掐女生脸蛋图片卡通头像 简单动物头像简笔画图片大全可爱图片 情侣头像男动漫动物头像 清晰花头像图片下载 掐女生脸蛋图片卡通头像 优美小清新图片女生头像女生 情侣头像三个男头像大全 古风可爱头像真人头像 血腥漫画人物图片头像女生头像 简单卡通情侣头像 简约 情侣图片唯美带字大图片头像图片素材 求求群头像图片大全女生 芽衣子男友头像 简笔画qq头像情侣头像图片大全可爱图片 海边 书 头像图片唯美清新 血腥漫画人物图片头像女生头像 情侣头像三个男头像大全 用狗狗做头像好吗 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 校园?社会! 我在末世飚个车 剑眼 玄门男神 屁民传说 百度 百度 百度 百度 百度 优美小清新图片女生头像女生 情侣动漫超清头像 古风可爱头像真人头像 情侣头像一男一女黑白头像图片 海边 书 头像图片唯美清新 情侣伤感照片卡通头像带字图片大全 用狗狗做头像好吗 关于牛的卡通头像男生头像 简单卡通素描图片女生头像图片大全可爱图片 情侣图片唯美带字大图片头像图片素材 情侣图片唯美带字大图片头像图片素材 情侣伤感照片卡通头像带字图片大全 情侣伤感照片卡通头像带字图片大全 海边女生孤独头像带字头像 用狗狗做头像好吗 哈士奇的头像图片搞笑图片 情侣动漫超清头像 情侣头像男动漫动物头像 芽衣子男友头像 简单卡通素描图片女生头像图片大全可爱图片 情侣头像超帅气 简笔画qq头像情侣头像图片大全可爱图片 简单动物头像简笔画图片大全可爱图片 用狗狗做头像好吗 古风图片伤感带字图片女生头像 关于牛的卡通头像男生头像 关于牛的卡通头像男生头像 简笔画qq头像情侣头像图片大全可爱图片 简笔画qq头像情侣头像图片大全可爱图片 清晰花头像图片下载 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网