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
狗狗病好了但不吃东西狗狗不吃蛋清狗狗病好了但不吃东西怎么办狗狗脖子长包狗狗脖子附近脱毛狗狗病好了但不吃东西狗狗脖子小疙瘩是怎么回事怎么办啊狗狗病好了但不吃东西怎么办狗狗不长胖狗狗脖子为什么很烫狗狗脖子上疙瘩软的狗狗病好了但不吃东西怎么办狗狗脖子小疙瘩是怎么回事啊狗狗脖子上疙瘩软的狗狗病了一天就走了狗狗脖子为什么很烫狗狗不爱理自己狗狗脖子上戴什么狗狗脖子上戴什么狗狗不会 飞机趴狗狗不吃不喝光吃肉狗狗脖子上戴什么狗狗不长胖狗狗不给清理耳朵狗狗脖子掉毛厉害怎么办啊狗狗不吃东西拉肚子怎么办啊狗狗脖子掉毛厉害怎么办啊狗狗不给清理耳朵狗狗不会 飞机趴狗狗脖子小疙瘩是怎么回事啊皇帝倒台后,各地军阀割据,民不聊生。货郎一家五兄弟各自走上不同的道路,老大小货郎一步步逐渐做成大生意,开的分号遍及周边。鼎盛时期竟然可以自己发行小区域流通货币。 老二在家务农种田。老三更是成为一代当地名医。老四和老五分别参加了不同的对立双方,直至把枪互相。怎样抉择?敬请阅读本书林阳穿越玄幻世界,成为一个小家族的外姓子弟 无资质无背景无机缘,原以为这辈子就这么平平淡淡过去了 不曾想,觉醒了万物编辑系统。 “淬体丹”经过编辑,变成了九窍金丹! “莽牛劲”功法经过编辑,变成了神象镇狱劲! “普通的丹炉”经过编辑,变成了全自动超神炼丹炉! “瞳术”神通经过编辑变成“重瞳术”! .. 就这样,林阳靠着编辑器,从小家族进入仙门,在仙门中崛起!不知多少年后,蓦然回首,发现自己早已永生,镇压万古一颗球形闪电包裹着一个灵魂来到地球,开启了一段神奇的旅程。“肖舜,你怎么还没死!” “都是你个废物拖累我女儿,要不是你,我女儿早嫁入豪门了!” 入赘三年,受尽冷眼,肖舜饮酒轻笑:“师傅,你让我守护姚家三年我做到了!现如今,我要那群曾经嘲讽过我的蝼蚁,统统跪下!” 江潮刚穿越古代,发现前身是个好吃懒做的主,家里还有一对苦命姐妹。 眼看断粮要饿死,江潮只能做个勤劳的小蜜蜂。 却不想日子有点盼头,土匪又上门了。 都不想我活是吧?那我就先弄死你,我可是全能特工,先弄几颗土雷轰你娘的。 土雷不怕?枪怕不怕?要不就搞几门炮炸你玩玩!没事,数理化哥全能。你来再多,有的是办法对付你。 朝为田舍郎,暮登天子堂! 从乡野到朝堂,江潮靠着领先这个时代千年的知识,竟渐渐握住了这个强盛王朝的脉搏。自上古以来,能长生久视者寥寥无几。如今星河异动,或许正是成仙的大好时机。少年星轲,怀懵懂入世,经生离死别、历万丈红尘,最终能否不醉星河?前路凶险万分,稍有不慎,便可能黄土不成。等待他的,是“云梦虚”、“生死妄”、“阎罗判”以及……修仙世界,林羽梦中竟然连通未来!? 从此之后,别人练功我睡觉;别人寻宝我睡觉;别人宗门打比我还是睡觉…… 为什么一直睡觉还那么强? 林羽:呵呵,吾好梦中修行! 截胡未来女帝自创功法,再传授给尚未成长为女帝的苏可儿。 林羽:此功法很适合你,一定要勤加练习。 苏可儿:竟然如此精妙!可……还有下卷? 林羽:咳咳,这个日后再说。 苏可儿:日后? 不知想到了什么,苏可儿面色变得发烫,羞红了脸,低声道,”那……就跟我进屋吧……“ 林羽:??? 大魏王朝,妖魔乱世,幽鬼横行。 当顾青玉睁开眼睛醒来之后却发现自己只有七日可活! 无奈之下,只好凭借驯养系统驯养一只青龟,将其化作自己的一个分身! 【叮!是否消耗成长点驯养青龟?】 【驯养成功!】 【青龟等级提升!】 …… 【叮!是否消耗进化点进化天元青龟?】 【进化成功!】 【天元青龟进化成为:天元龟!】 【叮!获得能力‘天元一气’!】 …… 顾青玉发现,自己驯养的分身不但可以不断升级,还可以不断的进化…… 叙述真实历史,回复人间头脑,树立基本认知。 在如今快节奏的生活社会环境下,无法拿起书籍来观看。这种情况,我的网文应运而生,满足在快节奏生活之下,只需要拿起手机就可以轻松汲取到正确的, 真实的历史。在书籍的海洋之中翱翔。在书的世界中体会,提高。充实自己,这就是我的书籍的目的。讲述了历史上发生的一切时间。内容面面俱到,时间节点准确无误。法师们目空一切,贵族们高高在上,大商会只手遮天;在这人吃人的世界里,我看到了深渊的触角,文明的退化,和微弱的希望。
重生之年代风华 一道仙缘 王者在上之灵域之眼 行轧大陆成神记 努力的活下去 留住青春一回眸 全球高武:天赋放大一万倍 三国:做卧底,被董卓偷听心声 一品权相 逍遥王破山河 扬天 逍遥小秀才 叶飞扬 满朝佞臣,孤要做千古暴君 侠骨天娇 现实中回首梦幻 我,范马孔子门徒,以德服人 神奇之环 妖神笔录 醉风月 狗狗不吃东西拉肚子怎么办 狗狗脖子上好几个疙瘩怎么回事啊 狗狗不爱理自己 狗狗脖子附近脱毛 狗狗不吃东西拉肚子怎么办 狗狗不吃东西拉肚子怎么办吃什么药 狗狗不爱理自己 狗狗脖子小疙瘩 狗狗不吃东西拉肚子怎么办啊 狗狗脖子小疙瘩是怎么回事 狗狗不爱运动后腿无力 狗狗不爱运动后腿无力 狗狗不喝没精神拉稀 狗狗脖子上好几个疙瘩怎么回事啊 狗狗病好了但不吃东西 狗狗脖子附近脱毛 狗狗不爱睡觉什么原因分析 狗狗不吃东西拉肚子怎么办啊 狗狗不吃不喝拉稀黑色 狗狗病好了但不吃东西怎么办 狗狗脖子上好几个疙瘩怎么回事啊 狗狗病好了但不吃东西怎么办 狗狗不吃不喝拉稀黑色 狗狗脖子上疙瘩软的 狗狗脖子为什么很烫 狗狗不喝没精神拉稀 狗狗不吃东西拉肚子怎么办 狗狗不吃蛋清 狗狗不吃不喝拉稀黑色 狗狗不吃东西拉肚子怎么办啊 狗狗脖子附近脱毛 狗狗脖子上好几个疙瘩怎么回事 狗狗脖子长包 狗狗病好了但不吃东西 狗狗不给清理耳朵 狗狗脖子掉毛厉害怎么办啊 狗狗脖子长包 狗狗不爱理自己 狗狗不喝没精神拉稀 狗狗病了一天就走了 狗狗脖子掉毛厉害怎么办啊 狗狗脖子小疙瘩是怎么回事 狗狗病好了吃点什么症状是什么症状 狗狗不爱睡觉什么原因分析 狗狗脖子上疙瘩软的 狗狗脖子上好几个疙瘩怎么回事 狗狗不爱运动后腿无力 狗狗脖子掉毛厉害怎么办啊 狗狗不喝没精神拉稀 狗狗脖子小疙瘩是怎么回事怎么办啊 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 超级人工智能 星际大航海:崛起 无敌魔主,签到奖励来败家 平潮停湖 末世,开局获得专属天赋 百家乐官网 澳门葡京游戏官网 葡京官网 百家乐官网 万利游戏官网 狗狗病好了但不吃东西 狗狗不会 飞机趴 狗狗脖子小疙瘩 狗狗病好了吃点什么症状是什么症状 狗狗脖子长包 狗狗脖子为什么很烫 狗狗脖子长包 狗狗病好了但不吃东西 狗狗脖子附近脱毛 狗狗不吃蛋清 狗狗不爱睡觉什么原因分析 狗狗不吃东西拉肚子怎么办 狗狗脖子上好几个疙瘩怎么回事 狗狗脖子掉毛厉害怎么办啊 狗狗脖子上好几个疙瘩怎么回事 狗狗不爱理自己 狗狗脖子为什么很烫 狗狗脖子上好几个疙瘩怎么回事 狗狗病好了但不吃东西 狗狗脖子为什么很烫 狗狗脖子小疙瘩是怎么回事啊 狗狗不吃不喝光吃肉 狗狗脖子小疙瘩是怎么回事啊 狗狗脖子小疙瘩 狗狗脖子小疙瘩是怎么回事怎么办啊 狗狗病了一天就走了 狗狗脖子附近脱毛 狗狗脖子掉毛厉害怎么办啊 狗狗不爱运动后腿无力 狗狗脖子小疙瘩是怎么回事怎么办