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
宝宝32周长到35周宝宝动了一天宝宝吃奶粉拉屎不成形18个月男宝宝身高体重标准两个月宝宝轻微拉肚子怎么办宝宝32周长到35周吃奶粉的宝宝脸上湿疹怎么办宝宝吃奶粉拉屎不成形18个月宝宝不说话18个月宝宝贫血99两个月宝宝干咳又咳不出来宝宝吃奶粉拉屎不成形一岁半宝宝可以吃海参吗一岁多宝宝吃得多拉的也多五个月宝宝可以吃豆腐吗18个月宝宝贫血99宝宝只吃菜不吃饭怎么办这几天宝宝喝奶只喝平时的一半这几天宝宝喝奶只喝平时的一半怀孕30周怎么算宝宝体重18个月宝宝咬牙这几天宝宝喝奶只喝平时的一半18个月宝宝不说话宝宝吃牛奶奶瓶有气往上冒两个月宝宝轻微拉肚子怎么办宝宝两个月大便从黄便成绿色宝宝头枕手机睡觉好吗宝宝吃牛奶奶瓶有气往上冒怀孕30周怎么算宝宝体重一岁半宝宝可以吃海参吗一个残疾人靠着幽默在现实直播中实现自身价值。 一个粉丝心中的无冕之王。 老婆多,是他的第一个标签。灵魂歌手,尿床是他的家常便饭。“当时太天真了,以为跟个大哥就有口饭吃,结果……”十三机众人擦擦泪,说:“现在肉都吃撑了,再吃就吃不下去了……大哥别打肉了,再打真吃不完了……什么?晚上还要做肉,老大求你了放我们出去打架吧!” “你们这算啥?”治安署的人一把鼻涕一把泪的说:“以为是两个破小孩拉起个组织要搞事儿,我们都准备好搞了加工资,你这谁想得到我们的治安还更好了……等一下,各位,我先不哭了,好像过了今天我们就是同一个老大了。” 这谁想得到?搞事情的组织还要当头。 这么说,工资的话…… “宣誓了,宣誓了。” 东南三区,并非长久安定;天下之稳,皆因大守门人。 “守门人 李思仁!” “守门人 张耀文!” “守门人 十三机机所有人。” “守门人 春秋战国集团。” …… “还有我还有我,这次我可赶上了。” “张家众人,李达夜和其徒张燚,参上!” 九幽。幽深之极地,墟,是一个残破的世界。我要前往那儿,埋葬那儿的魂。 啪! 醒木一拍,道的是江湖风风雨雨人情世故,道的是少年鲜衣怒马快意恩仇。 道的是将军醉卧沙场处之泰然,道的是侠客借酒消愁一情难断。 道的更是那听书人听到深处意犹未尽,却只能听见一句: “欲知后事如何,且听我下回分说!” 任人欺凌的吴用,从小就梦想有一天,挺自腰杆行侠仗义。 胸大无脑的杨茜茜,一直幻想着成为商界的女强人。 碌碌无为大半辈子的齐叔,总想着把45平米的洗衣店做到全国开花。 “做我陈越的朋友,心想事成,荣华富贵唾手可得。” “与我为敌,看看那些原始森林一般的坟头草,就知道他们的下场有多么的凄凉。。”【学霸文,甜宠风,黑科技,轻松日常】 “叮,恭喜宿主获得魅力*10。” “叮,恭喜宿主获得体质*10。” “叮,恭喜宿主获得智力*10。” “叮,恭喜宿主获得神级记忆力和悟性,可一目千行,过目不忘,举一反百……” 林北猝死,却魂穿平行世界,还从高三开始,并绑定神级全能学霸系统。 从此学水不在,一代神级学霸诞生。 “既然上天给我重生的机会,那我将脱胎换骨,努力上进,活出灿烂,不负本心。” 林北:“???” “咦,大家这是肿么了?” “我才出三分力,怎么就全倒下了?” “既然一个能打的都没有,那我只能研究曲率引擎和虫洞,探索星辰大海了啊!” 众人:“……” “收手吧阿北,求给条活路吧!” “我以为我考满分就够强了,可见到北神才知道,原来我还很菜……” “我以为我擅一道就厉害了,可北神竟天文地理,琴棋书画,医术体能,无所不精……” 又名《我,超级学霸,专治一切不服》《人在学校,离我远点,别打扰我看书》 李相,一名24岁大学生 意外穿越到武侠修真世界 从武侠小白变成行走江湖四处留名的一代大侠 一路上鲜衣怒马,一路上血溅四方 经历过众叛亲离,历经过人间温暖 敢问在下何人 “李相是也” 一位满目苍桑的老人,眯着眼倚坐在藤椅上,知吖吖的响着。藤椅旁,大黄趴在地上睡的正香。老爷子看起来就像是已经入土为安,躺倒在这片土地上一般。 一道光线照在老人身上,老人缓缓张开双眼。一个穿着黑衣的少女,站立于光束之下,看着这个年过花甲的老人,她的脸色有些悲戚,但却带着坚毅,眼中有着无尽的痛苦,看向这个老人的眼神也充满了复杂的感情。少女的右手紧握,似乎是用了极大的力气握住手中的长剑。 少女看向老人,嘴角露出一丝微笑。 “你来了”老人看着面前的少女,没有丝毫的惊讶,似乎早有预料,淡淡的说道。我每次送盆去给阿婆,她都请我喝咖啡,她很喜欢咖啡和鲜花,为人开朗,豁达,有很强的亲和力。少年陈枫身怀绝世神器,修盖世魔功。战人界、屠魔界、挑仙界、冲神界。打遍诸世界,杀出冲天血路,成就无上至尊。(声明:新书发布,各位新老书友多多支持。群号:158697732)
人皇图录之唯我独尊 澧水悠悠梦 仙恒录 元鸿纪 遗落的亡冠 山道弯弯下 我的城市小老婆 异世代:平行地球流浪记 诸天签到:从魁拔开始 青春与热爱 漫漫修行刀剑狂 宇宙地球人间游戏 重生东汉末年之我为刘协 来自云梦山 救世与轮回 末世从人性荒岛开始 从鬼灭开始穿越世界 重生敖丙之重振朝歌 万古独行客 药司 把睡觉宝宝吵醒 37周生的宝宝都有多重呀 宝宝只吃菜不吃饭怎么办 两个月宝宝轻微拉肚子怎么办 把睡觉宝宝吵醒 两周岁女宝宝腿看的怎么有点弯 宝宝只吃菜不吃饭怎么办 23个月宝宝词汇量 宝宝两个月大便从黄便成绿色 一个月宝宝3天不拉屎 18个月宝宝不说话 宝宝流眼泪可以接种 孕37周饥饿时宝宝动的厉害 37周生的宝宝都有多重呀 宝宝32周长到35周 两个月宝宝轻微拉肚子怎么办 氨溴特罗口服溶液宝宝 宝宝两个月大便从黄便成绿色 孕29周宝宝忽然很用力的踢我 宝宝吃奶粉拉屎不成形 37周生的宝宝都有多重呀 五个月宝宝可以吃豆腐吗 宝宝动了一天 一岁多宝宝吃得多拉的也多 18个月宝宝贫血99 孕37周饥饿时宝宝动的厉害 宝宝两个月大便从黄便成绿色 宝宝动了一天 孕29周宝宝忽然很用力的踢我 宝宝两个月大便从黄便成绿色 两个月宝宝轻微拉肚子怎么办 两个月宝宝干咳又咳不出来 18个月男宝宝身高体重标准 宝宝32周长到35周 宝宝吃牛奶奶瓶有气往上冒 两个月宝宝轻微拉肚子怎么办 18个月男宝宝身高体重标准 宝宝只吃菜不吃饭怎么办 孕37周饥饿时宝宝动的厉害 五个月宝宝可以吃豆腐吗 宝宝头枕手机睡觉好吗 一个月宝宝3天不拉屎 生完宝宝二十多天来月经正常吗? 氨溴特罗口服溶液宝宝 一岁多宝宝吃得多拉的也多 37周生的宝宝都有多重呀 宝宝流眼泪可以接种 宝宝头枕手机睡觉好吗 孕37周饥饿时宝宝动的厉害 吃奶粉的宝宝脸上湿疹怎么办 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 若世:星启混沌 我未曾扑向光明 一剑凌尘西边来 超神模拟,我有无数世界 了然若流 亚星管理平台 澳门葡京官网 AG真人 亚星管理平台 万利官网 两周岁女宝宝腿看的怎么有点弯 怀孕30周怎么算宝宝体重 这几天宝宝喝奶只喝平时的一半 怀孕30周怎么算宝宝体重 宝宝吃牛奶奶瓶有气往上冒 宝宝吃奶粉拉屎不成形 宝宝流眼泪可以接种 一个月宝宝3天不拉屎 18个月宝宝不说话 18个月男宝宝身高体重标准 宝宝32周长到35周 宝宝头枕手机睡觉好吗 一个月宝宝3天不拉屎 这几天宝宝喝奶只喝平时的一半 宝宝头枕手机睡觉好吗 两周岁女宝宝腿看的怎么有点弯 两个月宝宝轻微拉肚子怎么办 两个月宝宝干咳又咳不出来 宝宝只吃菜不吃饭怎么办 37周生的宝宝都有多重呀 这几天宝宝喝奶只喝平时的一半 23个月宝宝词汇量 怀孕30周怎么算宝宝体重 宝宝32周长到35周 生完宝宝二十多天来月经正常吗? 一岁半宝宝可以吃海参吗 18个月宝宝贫血99 宝宝喝奶粉大便干燥 宝宝动了一天 宝宝两个月大便从黄便成绿色