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
信用卡1 1办卡信用卡 预授权 没确认信用卡11万金卡信用卡12期什么意思信用卡12期什么意思是什么意思信用卡1 1办卡信用卡1号账单日几号还款信用卡11万金卡信用卡30000信用卡1号还款几号刷信用卡18个点贵么信用卡1 1办卡信用卡1号账单日信用卡18个点贵么信用卡11万金卡信用卡1号还款信用卡1号账单日几号还款日信用卡12期什么意思是什么意思信用卡12期什么意思是什么意思信用卡激活信用卡300000信用卡15000高不高信用卡30000信用卡 直接换外币信用卡12期什么意思啊信用卡 预授权到支付信用卡12期什么意思信用卡 直接换钱信用卡激活信用卡1号账单日几号我秦飞,这辈子,有刀,有守护之人,足以。一场阴谋使他从一个富家公子一夜之间沦落为一无所有的街头乞丐,亿万家产纷纷落入他人手中。 面对众人的嘲笑和凌辱,让他内心产生出一个极大的复仇欲望。 直到一人的出现从此改变了他的一切!赵阳意外绑定可以往返现代与明末的传送门。 穿过传送门,对面是气势汹汹,向着他冲刺而来的八旗骑兵。 数次尝试都铩羽而归,赵阳直接上交传送门,与官方合作。 当官方看到赵阳展示的另一个世界后,整个大夏都为之轰动。 一个星球的资源,一个全新的未开发世界! 大夏官方第一时间下定决心,制定绝密计划,设置最高权限。 终于,再次踏入明末大地的赵阳。 身后,是一条蓄势待发的庞然巨龙……“大王,那孙猴子马上就到!” 崔珏醒来穿越成了地府判官。 而且孙悟空马上就到! 什么?他想大闹地府? 崔珏直接嘴遁的他服服帖帖! 天蓬元帅转世成猪? 崔珏直接从根源上杜绝一切! 唐僧变成柔弱僧人? 崔珏让他变成武力值爆表的肌肉兄贵! 一切为了能够在地府朝九晚五的安心上班。 谁都不能打扰崔珏上班!我本无意争锋,却被迫推上高位,在血与火中,一步步走到天的举世瞩目的高度,那么就剩下天了......来自他的故事传奇。特种兵赵阳一觉醒来却发现自己竟然魂穿三国时代,并且获得了无双帝皇系统。他从此开始收名将,纳美人,灭刘备,退孙权,拒曹操煌煌一世。曹操:“我曹氏子弟不如子炎分毫。”刘备:“谁能帮我除了赵子炎,我封他为王。”孙权:“赵子炎是上天派来惩罚我的吗?”赵阳:“我还没发力,你们全倒下了,还让我怎么玩啊?”最后问鼎江山一统天下。赵阳看着眼前的皇座,心中无限感慨:“我本低调,但实力不允许,奈何奈何~~”  这是一部可以慢读的作品。 雁的历程,是起飞,相遇,亦可以是返回.   主角有不同于常人的亡灵视角;但在这个崇尚力量的世界,单凭一双眼睛就能看得透彻? 你们总说我有天赋,为什么加上实力不行?   雁阿九已经在外漂泊了六年,现在到了回去的时候了......   穿越平行世界,开局就被女星污蔑,沦为史上最强渣男。 结果开启搞事系统。 从系统开启的那一刻,就注定严谨是娱乐圈的一股泥石流。 面对媒体: “我说那不关我的事情你信吗?!” “真的,她说要蹭我的流量,所以……主动找我,我真是无辜的啊!” “你们不相信?我审美是在线的,就她那样的……我也瞧不上啊!” 凭借着自己的才华,他让网友又爱又恨。 甚至还被亲切的称之为——娱乐圈质检员!活在这个动乱的年代,身为江湖大佬的许锐锋已经很疲惫了,当他准备相亲过点小日子时,没想到竟然相亲相回来一个间谍…… 她,深入敌营窃取情报; 她,组建底下情报网络向中央传递信息; 她,在敌后无孔不入,备受嘉奖。 当全世界都以为这个女人是王牌特工时,她,却矮下了身子正在给许锐锋洗脚。 因为她知道,没有这个男人,自己早死了成千上万回,而整个北满的日本人都在以抓到这个男人为荣。 他,就是北满第一杀手,左手枪王,北满地下秩序的统帅,大老许。在渐渐步入和平的大陆上,阴谋于野心藏于不可见的黑暗中。本来应在棋盘之外的无逝,意外的卷入纷争。少年历经打磨成为锋利的刀,劈开棋盘,走向属于他自己的远方。   为了想要去到的方向,少年肩负着亲人朋友的希冀。   “在没到达尽头之前,我不会停下!”
锦钦 寒庚纪 神级操盘手 宝可梦世界的冒险 大阴阳神术 极道人神 无限大陆发展史 少年时之九零后 人在末世,进化万物 红尘诉求 绝代阴阳养鬼师 我是你的小公猪啊 云海天涯剑 末日新生之林落 大明千王 CSGO之世界顶峰 诡秘降临:我在港综世界学斩神 末法封魔人 警监刘澄 全民领主:我能看见武将进化路线 信用卡 预授权到支付 信用卡1号还款 信用卡20000分期还款 信用卡12期什么意思是什么意思 信用卡 预授权 没确认 信用卡 直接换钱 信用卡20000分期还款 信用卡1号还款日钱不够 信用卡 征信报告 额度 信用卡1号账单日 信用卡2万1年利息多少钱 信用卡2万1年利息多少钱 信用卡 直接换外币 信用卡1号还款 信用卡1 1办卡 信用卡12期什么意思啊 信用卡2017推荐 信用卡 预授权到支付 信用卡 逾期 还款 额度怎么办理 信用卡11万金卡 信用卡18个点是多少钱 信用卡11万金卡 信用卡 逾期 还款 额度怎么办理 信用卡15000高不高 信用卡1号还款几号刷 信用卡 中行 10万 信用卡 预授权到支付 信用卡 逾期 还款 额度怎么办理 信用卡 逾期 还款 额度怎么办理 信用卡 征信报告 额度 信用卡12期什么意思是什么意思 信用卡18个点是多少钱 信用卡12期什么意思 信用卡1 1办卡 信用卡 直接换外币 信用卡12期什么意思啊 信用卡12期什么意思 信用卡20000分期还款 信用卡 直接换外币 信用卡12号最后还款日 信用卡12期什么意思啊 信用卡1号还款日钱不够 信用卡激活 信用卡2017推荐 信用卡18个点贵么 信用卡18个点是多少钱 信用卡2万1年利息多少钱 信用卡12期什么意思啊 信用卡 中行 10万 信用卡1号账单日几号还款日 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 拾少年 传奇之异族崛起 追随我 重生85:财富人生 元素方舟 百度 百度 百度 百度 百度 信用卡1号账单日几号还款日 信用卡1 1办卡 信用卡 逾期 还款 额度怎么办理 信用卡1号账单日几号还款日 信用卡18个点贵么 信用卡12号最后还款日 信用卡12期什么意思 信用卡激活 信用卡→广发商城→积分兑换 信用卡1号还款几号刷 信用卡300000 信用卡 直接换钱 信用卡15000高不高 信用卡1号账单日 信用卡11万金卡 信用卡18个点是多少钱 信用卡激活 信用卡1号账单日几号 信用卡12期什么意思是什么意思 信用卡 逾期 还款 额度怎么办理 信用卡300000 信用卡18个点贵么 信用卡18个点是多少钱 信用卡12期什么意思 信用卡1号账单日几号 信用卡1号还款 信用卡30000 信用卡 征信报告 额度 信用卡12期什么意思是什么意思 信用卡1号还款日钱不够 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网