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
狗狗便便里有透明粘稠狗狗鼻子痒打喷嚏狗狗便便特别臭寄生虫狗狗便便有红色狗狗便便有红色的狗狗便便里有透明粘稠狗狗裁耳的目的狗狗便便特别臭寄生虫狗狗产道结构图狗狗不愿回家怎么办狗狗不喜欢洗屁屁狗狗便便里有透明粘稠狗狗不在笼子里呆着狗狗不喜欢洗屁屁狗狗便便特别臭寄生虫狗狗不愿回家怎么办狗狗裁耳发炎多久能好狗狗便便中有颗粒狗狗便便中有颗粒狗狗便便黄黑色带血丝狗狗产道示意图狗狗便很稀带血狗狗厕所自己怎么做狗狗避孕针多少钱一针狗狗便便有红色的狗狗鼻子咬破狗狗便便有红色狗狗必须打疫苗么狗狗便便黄黑色带血丝狗狗不在笼子里呆着我想只有在我写完故事的最后一刻,我才知道这个故事到底讲诉了什么。人在做,天在看,天知、地知,你知,我知!作恶者为非作歹,祸乱人间,躺赚不义之财,妄想游离于法网之外,欺天瞒地,逍遥自在,潇洒快活!殊不知,不是不报时候未到!天网恢恢,疏而不漏!恶者恒恶,善者永善,公道自在人心!美女别跑呀! 落魄单身狗---林枫内心抓狂。 《人生游戏》? 你,这是个什么样的游戏软件呀? 魔幻! 令人不敢想象,可这一切正诡异地发生着…… 老天爷哪!这个世界到底怎么了? 世人震惊地看着这个变幻莫测的世界,眼里满是恐惧…… 红芒! 满眼是红芒! 骆辑穿越平行世界,获得神话编造系统!具现神话视频,可获得情绪点,情绪点可兑换一切! 于是… 锈红行星格赫罗斯播放天体之音 原住民亡灵携带复仇之火,羽蛇神在圣山嘶吼 丰都城内,群鬼受刑, 泰山脚下,府君西行!爱情的路上没有对错,有的只是遇见与错过。。。我的家在北方农村,在长达两百年的动乱之中,我生活的小农村,发生过许多离奇的故事,这些故事,成了老辈人们口口相传的传说麟羽意外穿越到了三界混乱时期,还获得了系统,关于麟羽如何一统三界就只能看他自己的了,开局一个系统装备全靠买。在地府里有一个灵魂交易管,一个灵魂帮她实现前世心愿,一经交换概不退换诸神之局,吾为棋,吾之局,众生为棋。 拥有神秘老者赠予的黑塔,拥有追寻武道之巅的决心,这一生必踏破天穹,手持天道,成为万千世界的至尊之神。简介:红孩儿桀骜不驯,屡次不听教诲,被观音罚下人间,沦落成稀有动物。历经磨难,终于明白以强欺弱的严重后果。在奄奄一息之际得到观音的点化,可以重新为人,开始人间一个接一个的奇缘……
系统让我无敌 拥有超能力后的我 仙罹 云飞志 白桦刻命 转生异界百兽岛之史莱姆篇 玄幻:异界觉醒修仙系统 十方天陆 大宋王朝那些事儿 火影忍者之无尽的旅途 具象师 真仙人 信了吧!我带着高冷校花去捞尸 奇异国 新回家的诱惑 大明:我能翻阅华夏图书馆 毕加索的交流 破劫传说 阴阳冥使! 捣蛋闯天下 狗狗鼻子痒打喷嚏怎么回事 狗狗不喜欢下雨 狗狗裁耳发炎多久能好 狗狗便便中有颗粒 狗狗鼻子痒打喷嚏怎么回事 狗狗鼻子一直湿的 狗狗裁耳器使用方法 狗狗不愿意进家门 狗狗鼻子咬破 狗狗不在笼子里呆着 狗狗厕所自己怎么做 狗狗厕所自己怎么做 狗狗避孕针多少钱一针 狗狗不愿回家怎么办 狗狗便便黄黑色带血丝怎么回事 狗狗便便有红色的 狗狗裁耳器使用方法 狗狗鼻子咬破 狗狗产道示意图 狗狗便便里有透明粘稠 狗狗不喜欢下雨 狗狗便便特别臭寄生虫 狗狗鼻子痒打喷嚏 狗狗便很稀带血 狗狗不愿意进家门 狗狗避孕针多少钱一针 狗狗鼻子咬破 狗狗鼻子痒打喷嚏 狗狗产道示意图 狗狗鼻子咬破 狗狗便便中有颗粒 狗狗不喜欢下雨 狗狗便便有红色 狗狗便便里有透明粘稠 狗狗避孕针多少钱一针 狗狗便便有红色的 狗狗便便突然变少了 狗狗裁耳器使用方法 狗狗避孕针多少钱一针 狗狗便便突然变少了 狗狗便便有红色的 狗狗不愿意上楼梯 狗狗便便黄黑色带血丝 狗狗藏着一条腿趴着 狗狗便很稀带血 狗狗不喜欢下雨 狗狗厕所自己怎么做 狗狗便便有红色 狗狗边走边尿失禁 狗狗裁耳的目的 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 梧桐树的影子 乱世的故事 鸿轩记 三界无尘 都市最强高富帅 AG真人 欧博官网 亚星管理平台 AG真人 皇冠登3出租 狗狗不喜欢洗屁屁 狗狗便便中有颗粒 狗狗产道结构图 狗狗便很稀带血 狗狗不愿意进家门 狗狗藏着一条腿趴着 狗狗不愿意进家门 狗狗便便里有透明粘稠 狗狗不在笼子里呆着 狗狗便便黄黑色带血丝怎么回事 狗狗鼻子一直湿的 狗狗便便特别臭寄生虫 狗狗裁耳发炎多久能好 狗狗便便有红色 狗狗裁耳发炎多久能好 狗狗鼻子一直湿的 狗狗鼻子一直湿的 狗狗鼻子痒打喷嚏怎么回事 狗狗便便中有颗粒 狗狗鼻子咬破 狗狗避孕针多少钱一针 狗狗便便有红色的 狗狗边走边尿失禁 狗狗裁耳器使用方法 狗狗便便黄黑色带血丝怎么回事 狗狗裁耳器使用方法 狗狗不愿意进家门 狗狗藏着一条腿趴着 狗狗便便特别臭寄生虫 狗狗产道示意图