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 in Bootstrap utilizes 12 columns that render out at widths of 724px, 940px (default without responsive CSS included), and 1170px. Below 767px viewports, the columns become fluid and stack vertically.

<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

p>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="span6">
        Level 1 column
        <div class="row">
            <div class="span3">Level 2</div>
            <div class="span3">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>

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>

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: 767px) { ... }
  /* Portrait tablet to landscape and desktop */
  @media (min-width: 768px) and (max-width: 979px) { ... }
  /* 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 hiding 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
j.44邮票兔生肖邮票设计者1984年的惊梦邮票两分飞行员邮票邮票印制局李昊马丁j.44邮票美国三角形邮票1984年的惊梦邮票在哪可以卖邮票邮票纪57凯旋归国3?D2去邮局买邮票的步骤1984年的惊梦邮票安徙生童话邮票小版张去邮局买邮票的步骤美国集邮集团邮票邮票纪57凯旋归国3?D2龙的邮票价格长江三峡一张邮票价格邮票印制局李昊马丁中国邮政孔雀80分邮票黄山邮票行情长江三峡一张邮票价格在哪可以卖邮票杜娟小型张邮票珍藏册邮票价值怎么算新邮票申购技巧邮票价值怎么算淘宝外国盖销戳邮票中国邮政孔雀80分邮票马年邮票1990假票意外穿越明朝下一任败家皇帝朱厚照身上,作为太子时,不断搞事情,不断败家,非但没有将明朝败亡,反而是将明朝带上了世界巅峰,万国臣服,仰望天朝大佬。 朱厚照的名言:本太子用点钱怎么了,这以后都不是我的吗?何况我现在父皇吃我的用我的,本太子说什么了吗? 与天对抗,共争仙路,一将功成万骨枯。 三息永恒,一声叹息,回首只叹一场空。 打破桎梏,杀身成道,亘古阴谋迷雾散。 上承仙元,下启道古,三世轮回永无终。现在还有多少人知道“满城尽白发,不敢忘大唐”的安西军,仅仅一万多人,他们在内无粮草、外无援军的情况下孤守西域四十多年,哪怕面对人数几十倍的敌军,誓死守护每寸河山 裴松之注下“行法严而国人悦服,用民尽其力而下不怨。及其兵出入如宾,行不寇,刍荛者不列,如在国中。其用兵也,止如山,进退如风,兵出之日,天下震动而人心不忧”,被魏书中记载“若此人不亡,终其志意,连年思运,刻日兴谋,则凉雍不解甲,中国不释鞍”的诸葛武侯,被人说只是个政治家,不配武庙十哲 历史上唯四的百人斩之一的杨再兴,我们都知道岳飞精忠报国,项羽神勇无双,又有几人记得杨再兴小商河一战,三百对阵十二万,阵斩两千! 对正史上唯一一名被单独列传的女将军 秦良玉,几乎没有人知道,远没有基于部分人物原型改编的戏剧、小说人物穆桂英、花木兰为人铭记,人家秦良玉才是真正的巾帼英雄! 诗仙李白的出生地碎叶城位于现在的吉尔吉斯斯坦境内,难不成李白不是中国人吗! 作品《敲开幸福的大门》,通过抑郁病患者老秦住院治病,揭示了现代人,由于生活、工作压力大,身体处于亚健康,直至患病,给家庭带来困难。提醒人们,要生活乐观,想方减压,敲开幸福生活的大门。重生丧尸即将来袭: “杨老板,您购买的十吨大米到了!还有五吨的小米,三吨黄豆……” ?“杨老板,您订购的一吨牛肉,和一顿猪肉,还有……鸡肉,鸭肉,都到了!” “杨老板,您加急订购的防弹玻璃,还有钢化门,还有加大款的太阳能发电板……已经全部运送到了。”? ? 李江,一个不是这个世界的人来到了这个世界。他没有比别人更多的本事,唯一的长处就是他有别人永远都没有的经验。经验这个东西,可以让一个平凡的人成为神,不是神话里面的神。 李江,觉得自己不是神。他只是多了一点别人没有的记忆,这是老天爷的恩赐;或者是上帝的奖励。总之,他来了,带着神一样的能力,来到了这个世界。他不是来改变这个世界的,但是世界却要注定因他而改变! 哥不是神!但哥却可以成为神话!神仙也要凡人做,然而修真文把修行写的如同魔道,真正的修行不在于声色有形,而在于无形,即使是修魔也不会像修真文那样,真正的修行界应该是什么样的呢?由我的文字给你展开,也由我的心为你们展开穿越重生,以你之躯,冠以汝名,还以尊严,赋予荣耀。我本无意争锋,却被迫推上高位,在血与火中,一步步走到天的举世瞩目的高度,那么就剩下天了......来自他的故事传奇。千万年前,星域顶级势力修罗族,战天族,一夜之间惨遭灭族,更是成为众生禁忌。从此,整片星空再无“修罗”“战天”之名。 武荒大陆,一名战奴少年习得神秘功法,从此逆天改命,修罗战天之名因他一人再次响彻整片星域! 万族因他而颤抖,天地因他而哭泣……
幻日 朔夜微茫 如果没有你出现,会怎样 恐怖游戏:我是鬼屋NPC 与神王负明 域界:双尊 玄幻:我是气运大反派 一念神魔:护主独心 七天使预言 火宿c 修仙:我能无限模拟人生 重生动漫世界穿越 云凤九天 极道横推:我以肉身镇压末日 女帝:世子才是真无敌 云慕月 电商狂想记 双瞳世 天仙魔帝 来自地狱的人类鬼差 修仙,不是闹着玩的 杜娟小型张邮票珍藏册 安徙生童话邮票小版张 在哪可以卖邮票 贺龙的邮票值多少钱 杜娟小型张邮票珍藏册 中国邮政孔雀80分邮票 在哪可以卖邮票 美国三角形邮票 中国人民邮政邮票全套 龙的邮票价格 兔生肖邮票设计者 大韩民国临时政府邮票 j.44邮票 安徙生童话邮票小版张 两分飞行员邮票 贺龙的邮票值多少钱 黄山邮票行情 中国人民邮政邮票全套 十分邮票电报大楼 邮票价值怎么算 安徙生童话邮票小版张 邮票印制局李昊马丁 淘宝外国盖销戳邮票 邮票纪57凯旋归国3?D2 马年邮票1990假票 j.44邮票 新邮票申购技巧 大韩民国临时政府邮票 大韩民国临时政府邮票 十分邮票电报大楼 邮票印制局李昊马丁 贺龙的邮票值多少钱 两分飞行员邮票 j.44邮票 杜娟小型张邮票珍藏册 邮票价值怎么算 两分飞行员邮票 画一张保护环境的邮票 杜娟小型张邮票珍藏册 美国集邮集团邮票 邮票价值怎么算 邮票 1995 17 中国邮政孔雀80分邮票 1981年金陵十二钗邮票 去邮局买邮票的步骤 贺龙的邮票值多少钱 二战值钱的邮票 邮票价值怎么算 中国人民邮政邮票全套 龙的邮票价格 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 侠骨天娇 异瞳通灵者 梦卜仙 了然若流 我与鬼神打交道 万利游戏官网 欧博游戏官网 欧博官网 万利游戏官网 AG真人 1981年金陵十二钗邮票 两分飞行员邮票 两分飞行员邮票 黄山邮票行情 黄山邮票行情 画一张保护环境的邮票 1981年金陵十二钗邮票 大韩民国临时政府邮票 十分邮票电报大楼 环保邮票的设计大赛 邮票纪57凯旋归国3?D2 龙的邮票价格 邮票印制局李昊马丁 邮票 1995 17 美国集邮集团邮票 1981年金陵十二钗邮票 贺龙的邮票值多少钱 十分邮票电报大楼 十分邮票电报大楼 在哪可以卖邮票 黄山邮票行情 龙的邮票价格 画一张保护环境的邮票 马年邮票1990假票 新邮票申购技巧 中国邮政孔雀80分邮票 特10邮票发行量 龙的邮票价格 邮票价值怎么算 邮票 1995 17