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
百天宝宝肺炎吐沫图宝宝14个月全身软百天后的宝宝吃母乳宝宝从小就用电蚊香宝宝打完五联疫苗宝宝打完疫苗手臂化脓宝宝鼻头长红痘痘宝宝大舌头看什么科宝宝2岁多了不好好吃饭是什么原因宝宝吃多宝鱼拉肚子宝宝肠胃感染发烧吃什么药宝宝大舌头看什么科宝宝百宝膏功效宝宝不喜欢跑怎么回事宝宝倒奶倒不出来宝宝吃多宝鱼拉肚子宝宝14个月全身软宝宝不爱喝喜宝奶粉宝宝不爱喝喜宝奶粉宝宝打了维生素k1宝宝3岁有口臭宝宝不爱喝喜宝奶粉宝宝2岁多了不好好吃饭是什么原因把宝宝的腿打肿了宝宝病毒感染的渠道百天宝宝肺炎吐沫图宝宝表情怪异使劲把宝宝的腿打肿了宝宝打了维生素k1宝宝百宝膏功效陈寻怎么也想不到,自己机缘巧合参加的一次相亲经历,竟然就此翻转了他的整个人生。自己练笔随笔安放之处地球圣人境界风逸清穿越仙界,从零开始修成仙帝,竟又被灵器反噬,穿越成为修真界一个杂役。 灵器轮回镜竟成了武魂,可以复制一切武魂,本来靠着仙帝记忆就可以为所欲为,如今有了轮回镜还有什么威胁! 彝族圣司提着一只拥有系统的仓鼠,一脸懵逼的表示原来你才是主角? 但是下一刻看见同样拥有系统的郑浩白,圣司露出了不屑的表情:感情系统这玩意这么不值钱,烂大街了都。 作为仓鼠的夜晰:…… 拥有诸天穿越系统的郑浩白:……一曲长歌动天下 一剑光寒十九州 救苍生,斩邪魔 宋鸾不负天下人世界越来越乱了!! 人类的贪婪导致世界末日, 丧尸堪比釜山行!!变异物种专门吃小孩子!! 辛亏我不怕 不要问为什么! 问就是我会抽烟!!!【滑稽】九州神王李长青,被兄弟偷袭陨落,却意外重生归来。 尘封万年的洪荒大妖,将成为他的助力, 万界之中,修最强之术,炼顶尖灵药,布绝妙大阵…… “前世我能登临巅峰,这一世我也一样可以,诸天万界,终有一天,我会卷土重来!” 一个神棍道士为了在小镇生存学习死去的师傅招摇撞骗在一次收服鬼魂的事件中慢慢的踏入了修仙的路程。看一个小道如何一步步的崛起与坑人。 一块不起眼的石头,内里竟然容纳一方世界。少年只是随手一捡,便是陷入沉睡。 十年一梦,梦里十万年。 醒来,家族没落,承受着家族的血脉诅咒,他能否逆天改命。大明万历四十八年,陈操因为一次意外魂穿明朝,开启了人生霸业之旅一个已被世人所遗忘的姬姓,一名贫困山区大学生姬小天如何穿越到三国之封神天下的,再现祖上荣光的
孟婆传说的由来 人生有悔 付振庭三进怀柔城 烈海王异世界之旅 穿越四年,突然被追杀? 禁锢! 太上剑魔 我在异世界种田 鼠乱诸天 我在阳间当阴使 独陆纪元 我是星际探险家 玄冥榜 仙人世界 侠道山河 少年吸血鬼与女勇者 静安思 被仙界除名竟成妖族王者 我眼中的天下 星际探险:我让大夏国运滔天 宝宝15个月出了6颗牙 宝宝扁桃体发炎最快的偏方大全 宝宝吃多宝鱼拉肚子 宝宝打完五联疫苗 宝宝15个月出了6颗牙 宝宝2岁多了不好好吃饭是什么原因 宝宝吃多宝鱼拉肚子 宝宝病毒感染的渠道 宝宝18个月送托班 宝宝不爱喝喜宝奶粉 宝宝把鼻涕喷不出 宝宝把鼻涕喷不出 宝宝5公斤用多大纸尿裤 宝宝扁桃体发炎最快的偏方大全 百天宝宝肺炎吐沫图 宝宝打完五联疫苗 宝宝T2阶段是什么意思 宝宝18个月送托班 宝宝鼻头长红痘痘 百天后的宝宝吃母乳 宝宝扁桃体发炎最快的偏方大全 把宝宝的腿打肿了 宝宝14个月全身软 宝宝大舌头看什么科 宝宝表情怪异使劲 宝宝5公斤用多大纸尿裤 宝宝18个月送托班 宝宝14个月全身软 宝宝鼻头长红痘痘 宝宝18个月送托班 宝宝打完五联疫苗 宝宝倒奶倒不出来 宝宝从小就用电蚊香 百天宝宝肺炎吐沫图 宝宝3岁有口臭 宝宝打完五联疫苗 宝宝从小就用电蚊香 宝宝吃多宝鱼拉肚子 宝宝5公斤用多大纸尿裤 把宝宝的腿打肿了 宝宝打了维生素k1 宝宝不爱喝喜宝奶粉 产妇感冒了可以带宝宝吗 宝宝T2阶段是什么意思 宝宝大舌头看什么科 宝宝扁桃体发炎最快的偏方大全 宝宝把鼻涕喷不出 宝宝打了维生素k1 宝宝5公斤用多大纸尿裤 宝宝吃的益生菌吗 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 抚顶红尘梦 大小姐的贴身夫婿 人生大梦,梦世轮回 娘子刚登基,我就成了全民公敌 无聊所言 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 产妇感冒了可以带宝宝吗 宝宝表情怪异使劲 宝宝吃多宝鱼拉肚子 宝宝9个多月腹泻怎么办 宝宝不爱喝喜宝奶粉 把宝宝的腿打肿了 宝宝把鼻涕喷不出 宝宝扁桃体发炎最快的偏方大全 宝宝2岁多了不好好吃饭是什么原因 宝宝2岁多了不好好吃饭是什么原因 宝宝不爱喝喜宝奶粉 宝宝不爱喝喜宝奶粉 宝宝倒奶倒不出来 宝宝T2阶段是什么意思 宝宝不喜欢跑怎么回事 宝宝15个月出了6颗牙 宝宝鼻头长红痘痘 百天后的宝宝吃母乳 宝宝吃的益生菌吗 宝宝5公斤用多大纸尿裤 宝宝从小就用电蚊香 宝宝18个月送托班 宝宝扁桃体发炎最快的偏方大全 百天宝宝肺炎吐沫图 宝宝18个月送托班 宝宝吃多宝鱼拉肚子 宝宝病毒感染的渠道 宝宝病毒感染的渠道 宝宝大舌头看什么科 宝宝倒奶倒不出来