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
6个月宝宝偶尔吐奶怎么回事宝宝拉屎就吐2岁宝宝喉咙处有硬块2岁宝宝夜奶的危害宝宝老伸脖子怎么回事6个月宝宝偶尔吐奶怎么回事宝宝口腔奶渍消失2岁宝宝喉咙处有硬块宝宝拉肚子大肠经宝宝咳嗽我的心情短语宝宝拉土色粑粑带泡沫宝宝拉蛋花样的大便7个月宝宝拉绿色的大便是怎么回事呢宝宝拉土色粑粑带泡沫宝宝拉肚子参岑白术散30天宝宝做腰椎穿刺2岁宝宝口吃了快半年了宝宝拉屎就吐宝宝拉屎就吐宝宝可以喝五红汤么宝宝老夜里咳嗽怎么办宝宝拉屎就吐宝宝老伸脖子怎么回事宝宝咳簌怎么办两个月宝宝拉奶瓣还希宝宝咳嗽我的心情短语宝宝拉肚子可以食补吗宝宝咳簌怎么办两个月宝宝可以喝五红汤么7个月宝宝拉绿色的大便是怎么回事呢股神林辰重生,为了看清人心,他放出破产假消息,结果让他心寒,不过却收获真正的友情,亲情和爱情…… 这是一个光怪陆离的世界,深色的天空中有血泪如雨,暗黄的地面上如龟背皲裂,在那座远古的大殿中,身边是魑魅魍魉张牙舞爪,身边是漫天仙皇,威逼九天,掂起了一枚棋子,放在那张棋盘上,“胜利者,你相信神明存在吗?”老者笑而不语,同样落下一子,我不得不专注于棋盘,额头沁下几滴汗珠,终于“将死!” 败北之后,我的眼神空洞了许多。 老者笑着伸出手,盖在我的头顶上,“我,不就是神明吗?”一天高二学生王羽被奶奶叫回家中,告诉了他世界的真相和家族的秘密,从此走上修真之路杨辰一朝穿越,回到东汉末年,成为杨彪的侄儿,弘农杨家的下一代家主。 开局杨辰就觉醒了气运图录系统,只要迎娶美人或者收服名臣武将就能激活气运人物图录,就能获得专属人物奖励。 汉室的根已经腐朽,杨辰决定离开洛阳,前往并州发展。 之后,杨辰一路壮大势力,灭了南匈奴、鲜卑、乌桓。 一年后,杨辰带着麾下并州强军,一路杀回洛阳,一举成为天下最强军阀。有少年和尚,喝酒吃肉,醉卧美人膝,由魔入佛…… 有少年道士,一只青驴、一名女鬼相伴,朝着道祖行进…… 有少年儒生,提笔写下传世之作,誓要做天下万灵的夫子…… …… 有人问少年:“你是谁?!” 白衣少年摸了一下腰间钝剑,仰头喝了口酒,咧嘴一笑:“吾名叶天,叶子的叶,天帝的天,来自秦国荒城,是一个天才丹师,更是一个天才修炼者……” 军迷们戏称,美军四大军种可以分为四个等级:海军是一等人,空军是二等人,陆军是三等人,海军陆战队是四等人。 体育迷们也戏称,中国四大球也可以分为四个等级:足球狗是一等人,篮球狗是二等人,排球狗是三等人,手球狗是四等人。 嗯?先等等,谁告诉你中国有‘四大球’的,不一直都是‘足篮排三大球’吗?手球狗,手球是个什么鬼? 手球在中国体育界的处境,和海军陆战队在美军的处境,还真是同病相怜。 美国海军陆战队,称得上是海军、陆军和空军三合一的产物,而且其待遇和地位也是美国四大军种中最低的,在美军中是妥妥的四等人。 而手球这项体育运动项目,也堪称是足球、篮球和排球三合一的产物,在中国体育界,手球也是团体球类项目中待遇和地位最低的,手球在中国体育界也是妥妥的四等人。 不过,再卑微的四等人,也有华丽逆袭的时候。叶云运气爆棚意外得到一个高纬度制造的次元面板, 并且利用面板走上了穿越诸天万界......直播算命只是表面,解救芸芸众生才是本意。 龙木生习得祖传医卜星象之术,替世人排忧解难,趋吉避凶。 而龙木生也利用这先天优势,开启了装逼之路。人类科技快速发展,机器人与人类的矛盾愈发严重,与此同时人类正式殖民土卫六。江戈,一个低级机器人,误打误撞进入 奥斯教授团队,参加了机器人生物转化科技项目研究,随着项目的逐步深入,江戈对教授的怀疑也愈发严重,终于,身世之谜揭晓巨大的阴谋摆在眼前,文明与文明的碰撞,机械与肉体的对抗,一切将何去何从..... 蓝星历2099年,全球最神奇、最火爆的游戏《超元宇宙》投入运营的第四十九个年头。这一年,游戏中一个命名“圣域”的新地图突然开放,再次震惊了全世界! 故事,由此而开始……
从奴隶开始的征服王系统 封澜传 疯狂小崽崽 胜者为王? 史上最强流浪汉 神隐之城 我的百变怪不可能这么可爱 北宋乱,我开局识破阴谋 东帝国 洛神赋英雄千金女 辞职去当玄术师 诸天传说系列集 万古长空路 死亡诞生序曲 人在迪迦我老婆是居间惠 异界元素 争霸 MC之创世神祝 灵之摆渡 重生1992 关于我在修真界那些事 8个月宝宝成长记录日记 宝宝可以拜佛吗 宝宝拉肚子可以食补吗 宝宝咳嗽可以做超导吗 8个月宝宝成长记录日记 7个月宝宝拉绿色的大便是怎么回事呢 宝宝拉肚子可以食补吗 宝宝口腔奶渍消失 7个月宝宝长牙怎么清洁 宝宝困了不让睡觉 宝宝拉屎就吐 宝宝拉屎就吐 2岁宝宝喉咙处有硬块 宝宝可以拜佛吗 宝宝拉墨绿色的稀水 宝宝咳嗽可以做超导吗 宝宝拉奶瓣还希 8个月宝宝成长记录日记 宝宝蓝莓泥用蒸熟吗 宝宝老伸脖子怎么回事 宝宝可以拜佛吗 宝宝老伸脖子怎么回事 宝宝蓝莓泥用蒸熟吗 宝宝咳嗽我的心情短语 宝宝可以喝五红汤么 2岁宝宝喉咙处有硬块 8个月宝宝成长记录日记 30天宝宝做腰椎穿刺 宝宝蓝莓泥用蒸熟吗 7个月宝宝长牙怎么清洁 宝宝咳嗽可以做超导吗 宝宝咳簌怎么办两个月 宝宝连续3月反复便秘 宝宝拉墨绿色的稀水 6个月宝宝偶尔吐奶怎么回事 宝宝咳嗽可以黄豆吗 宝宝连续3月反复便秘 宝宝拉肚子可以食补吗 6个月宝宝偶尔吐奶怎么回事 宝宝老夜里咳嗽怎么办 宝宝咳嗽可以黄豆吗 宝宝口腔奶渍消失 7个月宝宝拉绿色的大便是怎么回事呢 宝宝拉蛋花样的大便 宝宝连续3月反复便秘 宝宝咳嗽可以做超导吗 宝宝拉肚子参岑白术散 宝宝拉墨绿色的稀水 8个月宝宝成长记录日记 宝宝口腔奶渍消失 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 我有一座天道馆 长白树 我真的不想这么渣! 练写者 本就一生平凡 百度 百度 百度 百度 百度 宝宝拉屎就吐 宝宝咳嗽可以做超导吗 宝宝咳嗽可以黄豆吗 宝宝蓝莓泥用蒸熟吗 30天宝宝做腰椎穿刺 宝宝拉奶瓣还希 宝宝拉土色粑粑带泡沫 8个月宝宝成长记录日记 7个月宝宝拉绿色的大便是怎么回事呢 宝宝拉墨绿色的稀水 2岁宝宝喉咙处有硬块 宝宝连续3月反复便秘 30天宝宝做腰椎穿刺 2岁宝宝夜奶的危害 宝宝咳嗽可以做超导吗 宝宝拉稀特别2个月使劲 宝宝困了不让睡觉 2岁宝宝口吃了快半年了 2岁宝宝口吃了快半年了 30天宝宝做腰椎穿刺 8个月宝宝成长记录日记 宝宝拉屎就吐 宝宝拉稀特别2个月使劲 宝宝拉肚子可以食补吗 6个月宝宝偶尔吐奶怎么回事 宝宝老伸脖子怎么回事 宝宝困了不让睡觉 宝宝拉屎就吐 宝宝咳簌怎么办两个月 宝宝拉肚子参岑白术散 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网