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
银行贷款利息最低几厘短期消费性贷款 定义融通资产网络贷款我来贷贷款怎么样浙江民泰商业银行贷款银行贷款利息最低几厘什么是短期消费性贷款融通资产网络贷款纯芝麻分贷款app国家开发银行生源地助学贷款系过了元旦贷款好贷吗融通资产网络贷款贷款有骗人的吗过了元旦贷款好贷吗渭南本地私人贷款国家开发银行生源地助学贷款系项目贷款自有资金婚前公积金贷款婚后婚前公积金贷款婚后贷款展期需要实地调查吗如何确定公积金贷款年限婚前公积金贷款婚后纯芝麻分贷款app贷款垫还征信报告显示贷款审批奥迪一般最久能贷款多长时间征信报告显示贷款审批贷款垫还贷款展期需要实地调查吗贷款有骗人的吗上一秒还在午休的我 下一秒我睁开眼睛发现一切都变得陌生 我新买没有一个星期的空调呢,没有你我该怎么活 不对,现在我应该在梦里。 可是为什么被打会这么疼 够了,住手。想知道是不是做梦你不会打自己呀 我一脸无语看着刚认识不久的网红小姐姐小道士出世当警察,收魂、灭魄、封神明,几世轮回定天下。 布局不断为世人。 正可谓:时光为盘,魂做子,千年棋局起风云!荒古四凶兽,饕餮、穷奇、梼杌、混沌!  荒古四神兽,青龙,白虎,朱雀,玄武! 以及荒古瑞兽麒麟,齐聚龙渊脑海的神台之上。 在它们身后,竟然还拉着一尊神秘的铜棺! 铜棺苏醒,龙渊获得无上传承,开启逆天神藏。 从此,他驾驭九尊荒古巨兽,化身万界之王,踏平无尽神域。 诸天万界,漫天神佛,无不望风而逃,丧胆销魂!城市套路深,我要回农村,农村路太滑,人人都狡猾。 村医张小飞何德何能,让美女蜂拥而至?财富接踵而来? 世界沦为黑暗。 八方战皇争夺日月。 输死一战。 灵天万道、星河灵道,参战!! 战气世界沦为混乱,天道预谋一切开始,盘古封印十罪、邪罪显现主角命运不同,天道能让他成为传说吗?其他道者还内战吗?万物最后会不会灭亡? 噩梦BOSS们会实现伟大计划吗? 十罪圣龙、邪罪凶兽会寻找前世最强力量吗?身为最强转身能否成为传说?能否成为祖神与死敌一决高下!! “不想被命运掌控,就拿出你手中的兵器超越他们成为比他们还可怕的存在!!”   在新农村的进程中,包村干部李小姗与回乡创业青年杨军产生了感情,为了王凯有个更好的前途,她答应了王凯考公务员的要求,最终王凯考上了公务员,又遇到了高官之女,……故事曲折,情爱辛酸且看:迷情。   穿越洪荒,成为人皇燧人氏!   【叮!你获得万界聊天群邀请!】   【叮!鸿蒙火种系统激活,获得亿万倍增幅!】   以燧人氏之位格,分封人族火种,获得神火加持之人,获得修行速度十倍至亿万倍增幅!   以功德神火献祭,献祭物品品质亿万倍增幅!   被分封者献祭之时,获得亿万倍增幅!   祖龙:“燧皇,朕想要修仙!”   【嬴政向你献祭三千精兵,触发亿万倍增幅,你获得三千太乙金仙!】   聚万界之神物,培育洪荒人族。   养万界之英才,反攻巫妖二族!   巫妖大战开启之日,万界人族揭竿而起,反攻洪荒,人族君临诸天!这是一个很长的故事……万物进化时代来临,恐怖巨兽,新的物种,成千上万种超能力,孰优孰劣,且试锋芒。 在这高压混乱时代下,大学毕业不久的李健凭借一腔孤勇,重建秩序,引领时代,横渡星空,战遍万族,一人即文明。 千百年后,人们将那个血与火的时代称为天神纪元。 ........ 神秘女人:老公,凡事要动脑子...... 李健:媳妇你一人点亮科技树,我还要什么脑子,干就完事了,我刀呢! 天灵大陆,星海行省,罗海城。 辰宇尘的出生地,天灵历308年,他六岁从未见过父亲。一头乌黑的中长发长达24厘米散在后,头发两边的一点披在肩上,显得很是帅气、可爱,虽说只有六岁却又如同成人般的冷静。
侦探剧本杀 玄幻:娘胎修炼,开局绑定天道老婆! 米月的刑事 异域少年录 极品的重生人生 了不起的修真界 奈何穿越爱上我 生活随笔之二 监管之外 乘风灭道 天命:人道永恒 超能:我没有任何异能 俺是一个保安 末世,全能战神 平凡,平安,还是平天下 妖顺记 云梦生 灵域游神 这一世我无敌 钟山战纪 银行贷款500万5年 过了元旦贷款好贷吗 贷款有骗人的吗 我来贷贷款怎么样 如何确定公积金贷款年限 淄博贷款哪个公司靠谱 宜车贷按揭车可以贷款么 中央银行一般不对企业提供贷款 短期消费性贷款 定义 国家开发银行生源地助学贷款系 项目贷款自有资金 项目贷款自有资金 奥迪一般最久能贷款多长时间 过了元旦贷款好贷吗 贷款展期需要实地调查吗 渭南本地私人贷款 什么是短期消费性贷款 银行贷款500万5年 纯芝麻分贷款app 翼农贷款究竟需要多少费用 婚前公积金贷款婚后 翼农贷款究竟需要多少费用 纯芝麻分贷款app 征信报告显示贷款审批 街道口信用贷款 贷款20年和30年的区别 银行贷款500万5年 纯芝麻分贷款app 办理买车贷款需要什么材料 银行贷款500万5年 我来贷贷款怎么样 婚前公积金贷款婚后 融通资产网络贷款 贷款展期需要实地调查吗 奥迪一般最久能贷款多长时间 渭南本地私人贷款 融通资产网络贷款 宜车贷按揭车可以贷款么 奥迪一般最久能贷款多长时间 渭南本地私人贷款 征信报告显示贷款审批 北京公积金贷款额度最低多少 翼农贷款究竟需要多少费用 2015 个人消费性贷款规模 过了元旦贷款好贷吗 街道口信用贷款 办理买车贷款需要什么材料 征信报告显示贷款审批 贷款垫还犯法 什么是短期消费性贷款 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 幸运先生 从史莱姆开始的异世界生活 养成弟子后,我怎么无敌了 末世纪的疯子菱 鳞妖魇 葡京官网 快连下载 亚星管理平台 葡京官网 皇冠登3出租 贷款垫还 融通资产网络贷款 北京公积金贷款额度最低多少 办理买车贷款需要什么材料 翼农贷款究竟需要多少费用 宜车贷按揭车可以贷款么 征信报告显示贷款审批 纯芝麻分贷款app 买二手房可以使用公积金贷款吗 贷款垫还犯法 贷款垫还犯法 贷款有骗人的吗 宜车贷按揭车可以贷款么 中央银行一般不对企业提供贷款 纯芝麻分贷款app 什么是短期消费性贷款 贷款20年和30年的区别 短期消费性贷款 定义 我来贷贷款怎么样 2015 个人消费性贷款规模 翼农贷款究竟需要多少费用 浙江民泰商业银行贷款 贷款20年和30年的区别 买二手房可以使用公积金贷款吗 渭南本地私人贷款 贷款垫还 办理买车贷款需要什么材料 贷款有骗人的吗 贷款有骗人的吗 中央银行一般不对企业提供贷款