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
孟婆头像琵琶女头像气球男头像半截裙头像沉默头像男孟婆头像超牛头像气球男头像红黄条头像地产头像街潮头像孟婆头像够衰头像街潮头像气球男头像地产头像机械风头像沉默头像男沉默头像男剑女头像型男头像社萌头像黑色红黄条头像群头像温馨悲痛的头像男神头像.半截裙头像吃大盘头像剑女头像头像男简单以张小山的高中生活为主题,写了高中的各种事,反应青春 冰冷浩瀚的宙海,无数种族隐匿在黑暗之中,伺机猎捕它们眼中的低级文明,他们遵守远古的黑暗森林法则,混乱中夹杂着秩序,任何文明只要没有踏出自己的母星,就能继续无知、幸运的生存下去,犹如被圈养的猪羊...100年前,蓝星第一强国米力坚向月球发射先驱者0号,开始探索宇宙第一步,当人类还在为自己取得的成就欢呼的时候,一种未知的天外生物,通过搭载返航器偷渡到了蓝星....渣男开后宫,渣女坐东宫,而我不一样,根本没对象。 凭什么别人穿越以后,都是秒天秒地秒空气的横行霸道,凭什么别人的系统都是动不动就要抹杀宿主逼着他们上进,而我的系统却要我去谈恋爱,让我放纵,逼着我和姑娘们风花雪月,我王某人把话放在这里,我就是打一辈子光棍,从今往后当一辈子魔法师,也不会去完成任何任务的,狗系统,你就死了这条心吧!现在都新世纪了,我要自由的恋爱,抵制系统,还我自由,我要自由,自由万岁。 系统:马上将会有一股阵风袭来,请宿主做好准备! 3、2、1··· 王某人捂着鼻子含糊道:算你狠。不明日,灵气聚散,孕一神明,混沌始开。 清上浊下,天地得以开分。 绝地天通,分九重天,地十八层。 不周断,妖兽四起,尸山血海,民不聊生。 祖龙化力,平妖兽之乱,助秩序重修,现龙门、起天山,灵气借而复苏。 灵气始然,百家争鸣,拳脚技法、刀剑步招、丹药法门,皆而传之。 每逢十八,三界分合,灵气完足纯厚。 上天山,入重天,可获机缘,经劫难,入九重天,可为上神。 飞禽走兽,跃龙门,亦得造化。 妖兽鬼魅、近夜而行、夺精魄血肉、以逆天而修,堕入地浊,为大妖,称阎罗。 修士十八为修,替天行道,赶早悟化。 平常人家,不入不扰,食烟火、练拳脚,安之乐之。 周而复始,仙运再临,且看有缘者,乱世沉浮,得造化,显神通。 秦天明穿越小说世界,成为小说中一个戏份不多的反派。 系统:只要宿主你完美杀青,就能够带着本系统回到你原本的世界当龙傲天。 秦天明:简单,演反派我最在行了! 结果女主不按剧本来,开始疯狂倒贴。 秦天明:能别倒贴了吗?我只想杀青啊!男主呢?你怎么还抑郁了?!穿越到文娱行业刚刚起步的平行世界,方淮南激活了影帝系统,可以获得前世任意一位影帝级人物的表演经验! 他一个人就开创了华娱影坛十年的辉煌时刻! 他是《无间风云》里城府深沉的黑帮老大琛哥; 也是《枪燃》里忠义痞气交织的打手阿来; …… 正当所有人都以为方淮南只会演反派角色的时候, 他跑到横店去出演了《猫妖传》里五分钟的配角, 将盛唐气势下,那位如醉似癫的李白演出了神韵! 这时,所有人才知道方淮南的戏路宽阔到何等地步! …… 面对采访,融合了上百位影帝经验的方淮南很谦虚的表示: “我,不过是站在了巨人的肩膀上罢了。”靖元二年,北荒军攻破大梁都城,俘虏皇帝无嫔妃无数,城中烽火狼烟,屠戮成灾,这座屹立千载的中原王朝正在蒙受巨大的耻辱!绝望之际,一身着白袍的将军忽然杀出,身后无数白袍军如同幽灵,收割着北荒军的生命!北荒军大败,退兵百里,大梁王朝免去了灭国之危! 战后,人人都在寻找这位大梁的英雄,皇上更是下旨封其为有史以来第一位异姓王,为他建立寺庙,享大梁子民世代敬仰,可这位白袍将军却如同烟云一般,销声匿迹了。 与此同时,上京城赵家多了一位身受重伤的少爷……邵子伟参加自卫反击战自摆乌龙,误饮催情酒,艳遇黎氏慧贞,回国途中遇女兵欧阳文心,无功退伍,为解班长一家困难,先后倒卖国库劵、承包粮油加工厂、开办歌城、进入房地产、创办风投公司,先后与彭曦、方兰、金裕、向彤、孟雨欣、高岚、潘颂、顾秋燕、梁心蕊、桑雅、马文玉有感情瓜葛,得知自己患弱精症后,意外获得了乔慧的爱情,在绝望之中相认双胞胎子女,实现人生赢家。陌生朝代一品大将府的庶子,突然融合了一个现代人的记忆。 这段记忆会给他带来怎样的变化?又会给这个世界带来怎样的变化? 末世的日子不好过啊……
一代狂龙 谛劫:极仪之战 一道仙凡 神探王爷 我是正经学生 寰宇仙魔录 猛虎与恋情 末世:我的避难所无限升级 全球曝光:我的中二日记竟成真了 万古第一神 吾本凡胎 地球的再分裂:燕赵楚鼎立 扎西的前半生 重生之血光冲天 重生之太虚尊圣 六道葬仙图 九转玄龙经 猎魔:美味佳肴 少年时之九零后 世界的真相,你了解吗? 琵琶女头像 地产头像 机械风头像 沉默头像男 琵琶女头像 世勋头像图 头像青绿色 二柴头像 世勋头像图 够衰头像 耐看男头像 耐看男头像 群头像温馨 地产头像 孟婆头像 悲痛的头像 装饰品头像 男神头像. 顾源头像 孟婆头像 zh头像 气球男头像 顾源头像 萌头像黑色 带剑头像女 刮风头像 男神头像. 顾源头像 型男头像社 男神头像. 沉默头像男 zh头像 半截裙头像 孟婆头像 群头像温馨 悲痛的头像 聚光灯头像 头像青绿色 群头像温馨 聚光灯头像 悲痛的头像 二柴头像 剑女头像 装饰品头像 街潮头像 zh头像 耐看男头像 悲痛的头像 刮风头像 超牛头像 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 重生再来与龙同行 当冥帝苟在人间 元鸿纪 孤岛行 末世游轮行 亚星游戏官网 万利官网 欧博游戏官网 亚星游戏官网 葡京官网 彩色头像猫 zh头像 悲痛的头像 机械风头像 够衰头像 孟婆头像 萌头像黑色 耐看男头像 聚光灯头像 机械风头像 孟婆头像 彩色头像猫 机械风头像 街潮头像 聚光灯头像 聚光灯头像 剑女头像 彩色头像猫 悲痛的头像 萌头像黑色 二柴头像 琵琶女头像 刮风头像 装饰品头像 世勋头像图 超牛头像 彩色头像猫 型男头像社 萌头像黑色 萌头像黑色