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
信用卡做什么事透支70万信用卡最低还款什么时候还款日信用社的信用卡客服信用卡送行李箱信用卡太多了怎么管理信用卡做什么事透支70万信用卡最低还款信用社的信用卡客服信用卡最低还款什么时候还信用卡注销网上银行信用卡属于什么账户吗信用社的信用卡客服信用卡总额控制信用卡属于什么账户吗信用卡刷一千能提现多少信用卡注销网上银行信用卡最低还款额可以连续多长时间信用卡淘宝满减信用卡淘宝满减信用卡做不了分期还款怎么办信用卡最低还款什么时候还款信用卡淘宝满减信用卡最低还款什么时候还信用卡做不了分期还款信用卡太多了怎么管理信用卡最后审核要多久信用卡算小额信用卡做不了分期还款信用卡做不了分期还款怎么办信用卡总额控制当一个人,一件事坏到极点的时候,再怎么走都是希望,我也希望大家生活中处处充满希望,可以的话真想回到过去.....【模拟器系统】+【幕后大佬】+【密室逃脱】+【诙谐文风】。 这是一个既惊悚又搞笑的故事。 他永远能让玩家知道,什么叫生得自由,死得随机。 他也永远能让对手明白,什么叫以德服人,殡至如归。 他叫薛东! 在这个平行世界里,他就是神一般的存在。 因为斜刘海,永远遮不住他右眼的哀伤,更挡不住他锋芒四射的魅力。 然而,他却更喜欢隐于幕后,默默操纵着他人的命运……曹泽带着系统穿越大唐,只要花钱就可以抽到各种东西。 开局遇到程处默,误打误撞成了国师。 “陛下,如今灾民遍野,急缺大量粮食!” “不慌,国师那里有粮卖。” “陛下,边关告急!” “来人,去国师那里买点98K来。” “陛下,如今大唐建设急缺人力!” “带上国师,咱去国外走一圈。” 从此,大唐的龙旗插满了世界各个角落。 日光照耀之处,皆为大唐领土!菩提--盘古之心所化,与本元为友,广招门徒,合道为祖王昭,一个生活在普通城市的普通人。 一觉醒来穿越到原神世界,这时候的时间段是—魔神战争期间。 淦,别的穿越者刚传送就有外挂加系统,自己怎么什么都没有? 他尝试呼叫系统,这一叫,热闹了整个魔神战争。 “诸天万界无敌系统,以后姐罩你。” 麻了,王昭人已经麻了。 之后,他靠着这个“诸天万界无敌系统”,横扫异界,一步步成为世界之主。 注:本文的主角是有后宫的(大概?),看不下去的小伙伴对不住啦!高端的食材往往只需要最简单的……屠宰方法。 开具一张嘴,成长全靠吃。 你说那是神明的游戏? 在李乾看来那是他的餐桌! 怒涛骇浪中的三桅船…… 残酷淘汰的神诡游园会…… 迷雾中的异界都市…… 饕餮之力在他体内成长,喂养那股力量的便是神诡的血肉!现在还有多少人知道“满城尽白发,不敢忘大唐”的安西军,仅仅一万多人,他们在内无粮草、外无援军的情况下孤守西域四十多年,哪怕面对人数几十倍的敌军,誓死守护每寸河山 裴松之注下“行法严而国人悦服,用民尽其力而下不怨。及其兵出入如宾,行不寇,刍荛者不列,如在国中。其用兵也,止如山,进退如风,兵出之日,天下震动而人心不忧”,被魏书中记载“若此人不亡,终其志意,连年思运,刻日兴谋,则凉雍不解甲,中国不释鞍”的诸葛武侯,被人说只是个政治家,不配武庙十哲 历史上唯四的百人斩之一的杨再兴,我们都知道岳飞精忠报国,项羽神勇无双,又有几人记得杨再兴小商河一战,三百对阵十二万,阵斩两千! 对正史上唯一一名被单独列传的女将军 秦良玉,几乎没有人知道,远没有基于部分人物原型改编的戏剧、小说人物穆桂英、花木兰为人铭记,人家秦良玉才是真正的巾帼英雄! 诗仙李白的出生地碎叶城位于现在的吉尔吉斯斯坦境内,难不成李白不是中国人吗! 这是一个打游戏的男孩遇上一个女孩的故事。万古之前,天庭大战,分为了三大部分,其中月神阁,妖王殿为主。 到现在已经过去三万年,人类科技在进步,灵气在慢慢消退,月神阁,阁主与妖王殿妖王,不得不关闭通道下届去寻找办法 ,在偶然的机会遇到男主洛绎结社联盟,络网聚伙,号曰荡吧,颇成规模。中有孙者悟空,传闻乃为辽东人氏,及以草创之际沥血呕心,不为其功,熟料事业将成,卓然为粪首佛头,蛊惑盲流,立为一叚,东引祸水,西惹它言,今番已为群盗者之首也。我等众人,勠力同心,歃血而誓,诛此内贼,清平寰宇。余之有幸,得以著笔,跋序檄文,列书荟萃,集万千同袍之心,汇集新著,笔墨为矢,文言为锋,以此起兵,共讨瑕玊之蜮,故名为《讨孙平叛传》
幻散后往 一舞动四方 沉楼 我不小心获得了全能系统 异世界的机战生活 诡异入侵:我在人间镇压邪神 末世纪的疯子菱 人在京都,开局宰相之子 重整秩序 梦中的勇者 大人,现在是妖灵时代 拥有系统的最强猎兽骑士 吞噬帝尊南战天 超凡进化:横推九天万界 理想家园 一个异世界铁匠的传奇 五逆神诀 腥红警戒 多情少年无情刀 龙御灵轮:龙神九鳞之首 信用卡最低能透支多少 信用卡注销后说钱没还完 信用卡最低还款额可以连续多长时间 信用卡太多了怎么管理 信用卡最低能透支多少 信用卡最后审核要多久时间 信用卡最低还款额可以连续多长时间 信用卡转分期头一个月 信用卡最后审核要多久 信用卡转账给支付宝要手续费吗 信用卡最低还款可以随时取消吗 信用卡最低还款可以随时取消吗 信用卡做不了分期还款吗 信用卡注销后说钱没还完 信用卡做什么事透支70万 信用卡太多了怎么管理 信用卡最低还款公式 信用卡最后审核要多久 信用卡最低还款什么时候还款期限 信用社的信用卡客服 信用卡注销后说钱没还完 信用卡刷一千能提现多少 信用卡最低还款什么时候还款日 信用卡属于什么账户吗 信用卡注销网上银行 信用卡做不了分期还款吗 信用卡最后审核要多久 信用卡最低还款什么时候还款日 信用卡最低还款什么时候还款期限 信用卡最后审核要多久 信用卡太多了怎么管理 信用卡属于信贷 信用卡送行李箱 信用卡做什么事透支70万 信用卡做不了分期还款 信用卡太多了怎么管理 信用卡送行李箱 信用卡最低还款额可以连续多长时间 信用卡做不了分期还款吗 信用卡刷一千能提现多少 信用卡算小额 信用卡转账给支付宝要手续费吗 信用卡做不了分期还款怎么办理 信用卡最低还款公式 信用卡属于什么账户吗 信用卡注销后说钱没还完 信用卡最低还款可以随时取消吗 信用卡算小额 信用卡做不了分期还款吗 信用卡最低还款 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 天仙魔帝 我有亿万家财 异世:开局吞噬系统 进化文明年编史 从落魄太子到永夜君王 百度 百度 百度 百度 百度 信用卡做不了分期还款怎么办 信用卡最低还款可以随时取消吗 信用社的信用卡客服 信用卡最低还款什么时候还 信用卡最低还款什么时候还款日 信用卡做什么事透支70万 信用卡最低能透支多少 信用卡转账给支付宝要手续费吗 信用卡最后审核要多久时间 信用卡转账给支付宝要手续费吗 信用卡淘宝满减 信用卡总额控制 信用卡做不了分期还款怎么办 信用卡最低还款额可以连续多长时间 信用卡做不了分期还款怎么办 信用卡淘宝满减 信用卡做什么事透支70万 信用卡做不了分期还款怎么办 信用卡转账给支付宝要手续费吗 信用卡做不了分期还款怎么办理 信用卡送行李箱 信用卡注销网上银行 信用卡送行李箱 信用卡做什么事透支70万 信用卡太多了怎么管理 信用卡最低还款什么时候还款日 信用卡最低还款公式 信用卡最后审核要多久 信用卡属于信贷 信用卡算小额 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网