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
狐妖小红年漫画图片情侣漫画名字大全皇家小公主漫画漫画图片男生帅气学霸漫画真人版摄影狐妖小红年漫画图片亚蝶漫画全集皇家小公主漫画全本免费离线漫画下载独自一人图片漫画日本画风精致的漫画家皇家小公主漫画社乱 漫画下载日本画风精致的漫画家漫画女主给皇上当画师独自一人图片漫画虎虎漫画 天鹅绒之吻1后宫大不同漫画后宫大不同漫画杀戮跟踪漫画21全部都是大我的错漫画后宫大不同漫画全本免费离线漫画下载杀手47福利漫画漫画真人版摄影被同学征服妈妈漫画漫画隐藏的心讲的什么杀手47福利漫画杀戮跟踪漫画21社乱 漫画下载三人一狗,各自为各自的目标走在一起,开启了一段生活屌丝探险故事 0260年12月24日平安夜,米国旧铜山首现大批海兽,全城人民无一幸存! 0261年4月23日,北熊国出现6级海兽,全国沦陷! 0262年1月1日,新年第一天,华夏出现10级海兽,代号【饕餮】,华夏沦陷! ...... 0260年1月,华夏战神臣风重生到海兽爆发十一个月前。 他赢得高层信任,将在华夏近两万公里的海岸线上铸起一座钢铁长城! 外媒惊为:东方奇迹! “求求臣战神,打开国门放我们进去!” “我们要呼吸东方没有血腥味的空气!”诸天万界,融融大世。 万族争霸,血乱弥天。 一本封妖录,一条封妖路。 少年起于荒界,封妖万界,万古称尊。我的剑,我的心 堕入魔道,逆天而行遮天计划将破, 活在月色下的人类该何去何从。 活在阳光下的怪种从地狱里一涌而出。 ……… 看着眼前一排神明头上顶着的金圈。 “原来神明这么短命啊。” “那我不做神明了。” 少年发出桀桀笑声,“还是屠杀神明吧!”一个贵族叶帆重生在元宇宙刚刚开始的时候。 没有人比他更加清楚元宇宙到底是一个什么样的东西。 这是一个地球文明与高级文明联网的时代。 这是一个地球变异、人类接受各种全新科技、基因突变、生命进化的时代。 这是一个充满了机遇与挑战的时代。 前世的叶帆只能仰望强者,在卑微中走向死亡。 这一世,叶帆要向生命的终极进化迈进! 生活的点点滴滴、繁杂往事球票 树林,沼泽,血污,以及被抛弃的人便是这个岛上最常见的东西
噩梦教室 不思乐园 娘胎:开局觉醒幽冥魔体,女帝护道! 穿越后,我暴打仙侠大佬 天门计划 我的超凡力 狂风战魂 僵尸先生从白僵开始崛起 网游之不朽风华 抽刀难断回忆的河 封魔奇缘录 小飞侠李可可屠龙记 都市重生:我把老妈宠成仙 千鹤燃心 反派能有什么怀心思 宇宙之上是什么 末日桃花生存系统 重生奶爸:我打造娱乐帝国 这个剑神有点浪 斗破女性角色漫画大全 斗罗大陆免费阅读神漫画全集下载 虎虎漫画 天鹅绒之吻1 漫画真人版摄影 斗破女性角色漫画大全 家庭教师色漫画 迅雷下载链接 虎虎漫画 天鹅绒之吻1 色系漫画在地下城寻找 被同学征服妈妈漫画 少女漫画在教室 全本免费离线漫画下载 花开的一瞬间漫画 人缩小了邪恶漫画 斗罗大陆免费阅读神漫画全集下载 狐妖小红年漫画图片 漫画真人版摄影 花丛美人漫画 被同学征服妈妈漫画 与复仇有关的漫画 皇家小公主漫画 斗罗大陆免费阅读神漫画全集下载 漫画女主给皇上当画师 情侣漫画名字大全 日本画风精致的漫画家 独自一人图片漫画 人缩小了邪恶漫画 被同学征服妈妈漫画 情侣漫画名字大全 与复仇有关的漫画 被同学征服妈妈漫画 漫画真人版摄影 隔壁的小鬼好诱人漫画 漫画图片男生帅气学霸 狐妖小红年漫画图片 杀手47福利漫画 漫画真人版摄影 漫画图片男生帅气学霸 虎虎漫画 天鹅绒之吻1 人缩小了邪恶漫画 漫画女主给皇上当画师 漫画隐藏的心讲的什么 少女漫画在教室 冰?漫画更新 花丛美人漫画 日本画风精致的漫画家 斗罗大陆免费阅读神漫画全集下载 花开的一瞬间漫画 漫画隐藏的心讲的什么 人缩小了邪恶漫画 亚蝶漫画全集 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 独陆纪元 药司 我被要求和双马尾少女同居 万界之征战 作者交流群基地 葡京官网 欧博官网 亚星管理平台 葡京官网 皇冠登3出租 血腥撕妹漫画 社乱 漫画下载 漫画真人版摄影 被同学征服妈妈漫画 杀戮跟踪漫画21 血腥撕妹漫画 隔壁的小鬼好诱人漫画 后宫大不同漫画 全本免费离线漫画下载 日本画风精致的漫画家 独自一人图片漫画 花开的一瞬间漫画 色系漫画在地下城寻找 狐妖小红年漫画图片 社乱 漫画下载 情侣漫画名字大全 被同学征服妈妈漫画 斗破女性角色漫画大全 亚蝶漫画全集 漫画隐藏的心讲的什么 虎虎漫画 天鹅绒之吻1 被同学征服妈妈漫画 花开的一瞬间漫画 虎虎漫画 天鹅绒之吻1 狐妖小红年漫画图片 花丛美人漫画 与复仇有关的漫画 杀戮跟踪漫画21 与复仇有关的漫画 独自一人图片漫画