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
利用空姐贩毒的电视剧残忍爱情电视剧抗日除奸电视剧电视剧北平插曲一起打鬼子电视剧下载利用空姐贩毒的电视剧韩雪演过的谍战电视剧抗日除奸电视剧生活启示录电视剧第19级张嘉译最近的新电视剧2015年自誓:电视剧抗日除奸电视剧电视剧琅琊榜大结局剧情介绍自誓:电视剧钟汉良所有电视剧电影大全张嘉译最近的新电视剧2015年电视剧水色嘉南搜一下三妹电视剧搜一下三妹电视剧英国电视剧排行蚂蚱电视剧在线观看40搜一下三妹电视剧生活启示录电视剧第19级山海经电视剧有哪些电视剧人民的名义赵立春激战电视剧全集歌曲电视剧人民的名义赵立春山海经电视剧有哪些英国电视剧排行电视剧琅琊榜大结局剧情介绍一代战神,因失去记忆,流浪街头,却稀里糊涂成为了秦城豪门朱家的女婿。 受尽欺辱的他,受到重创,记忆恢复,王者归来。 且看他如何收拾曾经欺辱过他的宵小之辈?如何踩着那些为富不仁之徒踏上世界之巅?如何千里走单骑救父母于危难之中? 他就是令边境悍匪和国际雇佣兵闻风丧胆的龙国战神龙之刃林灿。穿越到1925年,成为从西点军校、D国军事学院毕业的张大帅第二子张宗卿。 偶获超级军工设计系统,各式超时代武器纷纷涌现。 彼时,时局维艰,华国尚未一统。 世界格局风云涌变,华国在二公子的带领下自此复兴,傲立于世。何为仙,何为凡,何为万古为众生? 仙为真,凡亦真,成仙逆凡顺本心。 弑仙榜,戮万界,灭仙屠神为永生。 凡人体,破天指,一梦黄粱尘归尘! 我秦殇,身负血仇,心有热血,为凡人一榜弑仙,为众生一指破天!我,叫做程刚,程是工程的程,刚是刚强的刚异界男儿就该征战四方!可当我和我的怨种队友们在异界终于出人头地的时候,我才发现原来只有我一个是这异界的本地人!一次机遇之下少年重获再活一世的机会来到了一处崭新的世界,这里没有花俏绚丽的魔法,人人却都崇尚修炼魂力,修行极其艰难却不断有人前仆后继,因为命运的安排少年同样踏上了这条永无止境的道路那他又会到达怎样的地步?这其中又会有多少命运的羁绊?又会有多少的艰难与辛酸...... &amp;lt;万界魂破&amp;gt;是我的第一本书,所以希望承蒙各位读者的关心深夜的酒馆,推杯换盏 和你喝酒的,究竟是人是鬼 没有归宿的灵魂啊 在这里,你将得到救赎洪荒道祖,天道化身,圣人之师这个世上有鬼吗? 真的有,而且有很多。 我叫徐艺,在我十八岁那年,我猛然发现了这个世界的真相。 一群“正义之士”在征服各次元的故事。
虚梦记 赶上穿书赘婿热潮后 重生:回到老婆死亡那一天 王逗传说 信鸿战纪 佩剑大厨 择途 逆生死破九天 大道帝辛 木叶火苗 神话:开局被女帝上门求婚 持剑傲天 无知的凶手 这个卡师绝对有问题 神之末代 灵霄之下 重生被女帝提亲 逆吞强噬 亏成首富从民国开始 洪荒英雄传 英雄传说 古代搞笑爱情电视剧大全集 11年前的国产电视剧 电视剧水色嘉南 一起打鬼子电视剧下载 古代搞笑爱情电视剧大全集 小视频电视剧 电视剧水色嘉南 爱情包邮电视剧演员 激战电视剧全集歌曲 smile 电视剧 好看的日本校园爱情电视剧 好看的日本校园爱情电视剧 2005年 谍影电视剧 11年前的国产电视剧 利用空姐贩毒的电视剧 一起打鬼子电视剧下载 同志电视剧请喜欢我 激战电视剧全集歌曲 2015湖南卫视电视剧表 抗日除奸电视剧 11年前的国产电视剧 抗日除奸电视剧 2015湖南卫视电视剧表 搜一下三妹电视剧 张嘉译最近的新电视剧2015年 2005年 谍影电视剧 古代搞笑爱情电视剧大全集 残忍爱情电视剧 2015湖南卫视电视剧表 激战电视剧全集歌曲 一起打鬼子电视剧下载 三少爷的剑的电视剧 电视剧北平插曲 利用空姐贩毒的电视剧 山海经电视剧有哪些 电视剧人民的名义赵立春 电视剧北平插曲 电视剧水色嘉南 2005年 谍影电视剧 钟汉良所有电视剧电影大全 电视剧人民的名义赵立春 爱情包邮电视剧演员 丽姬传电视剧全集下载 同志电视剧请喜欢我 自誓:电视剧 三少爷的剑的电视剧 好看的日本校园爱情电视剧 电视剧人民的名义赵立春 2005年 谍影电视剧 韩雪演过的谍战电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 这个召唤师不一样 我的百变怪不可能这么可爱 鬼兵异传 末世最强混子组织 侠与剑 百家乐官网 澳门葡京游戏官网 澳门葡京官网 百家乐官网 亚星官网 好看的日本校园爱情电视剧 生活启示录电视剧第19级 重庆演的电视剧有哪些明星 电视剧水色嘉南 smile 电视剧 残忍爱情电视剧 2005年 谍影电视剧 三少爷的剑的电视剧 重庆演的电视剧有哪些明星 电视剧北平插曲 张嘉译最近的新电视剧2015年 利用空姐贩毒的电视剧 电视剧水色嘉南 自誓:电视剧 古代搞笑爱情电视剧大全集 古代搞笑爱情电视剧大全集 11年前的国产电视剧 张嘉译最近的新电视剧2015年 搜一下三妹电视剧 韩雪演过的谍战电视剧 爱情包邮电视剧演员 2015湖南卫视电视剧表 好看的日本校园爱情电视剧 自誓:电视剧 电视剧琅琊榜大结局剧情介绍 小视频电视剧 2005年 谍影电视剧 11年前的国产电视剧 小视频电视剧 激战电视剧全集歌曲