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
jt信用卡贷款能贷多少西安支付宝芝麻分办信用卡租房宝为什么用信用卡支付不了光大银行信用卡被骗吉林市有办信用卡的业务员么jt信用卡贷款能贷多少交通银行信用卡车主卡租房宝为什么用信用卡支付不了汕尾哪里有建行信用卡安居分期淘宝购物用什么信用卡好焦作怎样申请信用卡租房宝为什么用信用卡支付不了泸州建设银行信用卡焦作怎样申请信用卡交通银行信用卡捷安特淘宝购物用什么信用卡好信用卡尾号不好曲靖网上申请信用卡曲靖网上申请信用卡信用卡分期手续费 贷款利息泉港套现信用卡曲靖网上申请信用卡汕尾哪里有建行信用卡安居分期信用卡还款逾期冻结了信用社信用卡取现利息房租可以刷信用卡吗信用社信用卡取现利息信用卡还款逾期冻结了信用卡分期手续费 贷款利息泸州建设银行信用卡作为一个男人,没有勇进之心等于平庸。 一个事物或情感的拿起或放下,需要勇气和魄力。 肃清心灵迎接晨光,让我们一起感受生活乐趣。 某一岁月时期,大道天雷惊天动地,末日黄昏,丧钟被敲响,钟声激荡在浩瀚无垠的古老宇宙中,伴着若有若无的举世恸哭声、伴着冥冥之中的厄运、还伴着难以琢磨的诡异妖邪…… 久远岁月过去,宇宙破灭,一切都不复存在,驻足在破败的座座坟冢前,得了长生的长生者众生御帝“荒极”放声大哭: “啊……举世独我,没有你们,长生好苦……我一定要复活你们,我一定要重演过往,哪怕等到所有宇宙都走向毁灭时,我也绝不会放弃。” QQ书友群号:1106045980宋徽宗时期宣和三年七月上旬,以张叔夜、张伯奋、张仲熊三人为首的三十六部雷将,十八位散仙团灭了梁山!这件事很快传到了天庭,天庭玉皇大帝立刻派观音菩萨从披香殿内释放了新一波的天罡地煞星下界聚义黑牙泊给宋江等一百单八将报仇,而玉帝不放心新一波下界的一百单八将便又派出十二星座战士和十八罗汉将军下界聚义红日山为黑牙泊好汉助阵!最终黑牙泊一百单八将和红日山好汉的配合下团灭了张叔夜一伙雷将,为宋江等一百单八将报了仇雪了恨“肖舜,你怎么还没死!” “都是你个废物拖累我女儿,要不是你,我女儿早嫁入豪门了!” 入赘三年,受尽冷眼,肖舜饮酒轻笑:“师傅,你让我守护姚家三年我做到了!现如今,我要那群曾经嘲讽过我的蝼蚁,统统跪下!” 江潮刚穿越古代,发现前身是个好吃懒做的主,家里还有一对苦命姐妹。 眼看断粮要饿死,江潮只能做个勤劳的小蜜蜂。 却不想日子有点盼头,土匪又上门了。 都不想我活是吧?那我就先弄死你,我可是全能特工,先弄几颗土雷轰你娘的。 土雷不怕?枪怕不怕?要不就搞几门炮炸你玩玩!没事,数理化哥全能。你来再多,有的是办法对付你。 朝为田舍郎,暮登天子堂! 从乡野到朝堂,江潮靠着领先这个时代千年的知识,竟渐渐握住了这个强盛王朝的脉搏。自上古以来,能长生久视者寥寥无几。如今星河异动,或许正是成仙的大好时机。少年星轲,怀懵懂入世,经生离死别、历万丈红尘,最终能否不醉星河?前路凶险万分,稍有不慎,便可能黄土不成。等待他的,是“云梦虚”、“生死妄”、“阎罗判”以及……春暖花开,落英缤纷,放手采撷,便是诗情!大魏王朝,妖魔乱世,幽鬼横行。 当顾青玉睁开眼睛醒来之后却发现自己只有七日可活! 无奈之下,只好凭借驯养系统驯养一只青龟,将其化作自己的一个分身! 【叮!是否消耗成长点驯养青龟?】 【驯养成功!】 【青龟等级提升!】 …… 【叮!是否消耗进化点进化天元青龟?】 【进化成功!】 【天元青龟进化成为:天元龟!】 【叮!获得能力‘天元一气’!】 …… 顾青玉发现,自己驯养的分身不但可以不断升级,还可以不断的进化…… 叙述真实历史,回复人间头脑,树立基本认知。 在如今快节奏的生活社会环境下,无法拿起书籍来观看。这种情况,我的网文应运而生,满足在快节奏生活之下,只需要拿起手机就可以轻松汲取到正确的, 真实的历史。在书籍的海洋之中翱翔。在书的世界中体会,提高。充实自己,这就是我的书籍的目的。讲述了历史上发生的一切时间。内容面面俱到,时间节点准确无误。法师们目空一切,贵族们高高在上,大商会只手遮天;在这人吃人的世界里,我看到了深渊的触角,文明的退化,和微弱的希望。
方,圆 魔祖出世,诸神避让 王者在上之灵域之眼 九则人世间 努力的活下去 龙尊剑帝 爱在下一个世界复苏 紫薇真经之内经篇 我谈着恋爱也吊打你们 境之破虚 枕中一梦 元宇宙:迷失 重生异虫女王,回到2020 重生官路重重 仙帝重生异世界之旅 鬼差日常 开我大秦盛世 超元宇宙 魇尸:世界新生 阴阳决之起源之战 信用卡的预授权 各家银行信用卡对比优缺点 信用卡尾号不好 吉林市有办信用卡的业务员么 信用卡的预授权 招商信用卡分期免息 信用卡尾号不好 招商银行信用卡代扣 房租可以刷信用卡吗 信用卡逾期三次公积金贷款 北京加油 信用卡 北京加油 信用卡 工行汽车信用卡分期 各家银行信用卡对比优缺点 jt信用卡贷款能贷多少 吉林市有办信用卡的业务员么 北京 加油 信用卡 房租可以刷信用卡吗 泉港哪里有代还信用卡的 租房宝为什么用信用卡支付不了 各家银行信用卡对比优缺点 交通银行信用卡捷安特 西安支付宝芝麻分办信用卡 焦作怎样申请信用卡 淘宝购物用什么信用卡好 工行汽车信用卡分期 房租可以刷信用卡吗 西安支付宝芝麻分办信用卡 泉港哪里有代还信用卡的 房租可以刷信用卡吗 吉林市有办信用卡的业务员么 一个人最多几张信用卡 光大银行信用卡被骗 jt信用卡贷款能贷多少 信用卡还款逾期冻结了 吉林市有办信用卡的业务员么 光大银行信用卡被骗 信用卡尾号不好 工行汽车信用卡分期 交通银行信用卡捷安特 信用社信用卡取现利息 信用卡逾期三次公积金贷款 车贷信用卡提前存钱 北京 加油 信用卡 焦作怎样申请信用卡 一个人最多几张信用卡 北京加油 信用卡 信用社信用卡取现利息 工行汽车信用卡分期 交通银行信用卡车主卡 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 梦宰沧溟 仙戮万界 创世神转世 法医的秘密 江湖,如梦楼 亚星游戏官网 万利游戏官网 万利官网 亚星游戏官网 澳门葡京官网 北京加油 信用卡 招商信用卡分期免息 北京加油 信用卡 交通银行信用卡车主卡 泉港套现信用卡 焦作怎样申请信用卡 淘宝购物用什么信用卡好 一个人最多几张信用卡 信用卡的预授权 汕尾哪里有建行信用卡安居分期 信用卡的预授权 交通银行信用卡捷安特 光大银行信用卡被骗 信用卡的预授权 交通银行信用卡车主卡 光大银行信用卡被骗 曲靖网上申请信用卡 吉林市有办信用卡的业务员么 信用卡分期手续费 贷款利息 信用卡还款逾期冻结了 一个人最多几张信用卡 北京 加油 信用卡 泉港套现信用卡 汕尾哪里有建行信用卡安居分期 招商银行信用卡代扣 车贷信用卡提前存钱 光大银行信用卡被骗 信用卡逾期三次公积金贷款 泸州建设银行信用卡 信用卡逾期三次公积金贷款