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
宫庄天气丹梭天气古拉天气哈地滨天气国门天气宫庄天气常熟天气网古拉天气大连湾天气鸡西的天气绩溪的天气宫庄天气禅堂天气广西年天气古拉天气鸡西的天气朝阳天气.合尔滨天气合尔滨天气根西岛天气店远天气合尔滨天气大连湾天气关鹅沟天气国门天气佛山天气温哈地滨天气高庙镇天气珙县的天气禅堂天气【直播+赘婿+日常=震惊世界?】 陈年为给母亲筹钱治病,成了一名糟心的上门女婿。 幸而天降愤怒系统,从此开启逆天之路。 【恭喜主播,解锁愤怒直播间】 嗯?积累粉丝愤怒值,能十连抽? “恭喜主播,抽取华夏币一个亿。” “恭喜主播,抽取采花派秘术,销魂手。” 有这好事?岳母大人,请再骂我一次! 等会儿,还有任务? 【粉丝呼声最高任务:掌掴岳母】 【粉丝呼声第二任务:惩罚小姨子】 直播间群狼仰天怒吼:狼王出征,寸草不生! (不舔狗,不圣母) (轻度开车,晕车勿入)虞朝十万年以来,各等修真家族层层把控修行资源,世人皆以为寒门再难出贵子的时候,孟浩然却是在暗中观察。 你们斗法,我种田……   你们打架,我囤货……   你们争夺,我抄底……   直到众人回过神来才发现,原本处于微末之中的孟氏一族已经逆流而上,步步为营,直抵巅峰仙家!简介:末世降临,一个出生于偏僻山村的普通草根小人物开启开挂人生,逆风成长,最终蜕变为人类守护者的故事。何须问,浮生情,原知浮生是梦中。 花落花开,人死只是重生的开始。 广袤无垠的具象大陆,具象者们,打通三脉七轮,修炼着脉气。 根轮开,红莲绽放,具象现: 腹轮开,橙莲绽放,具象量变: 脐轮开,黄莲绽放,变化现: 心轮开,绿莲绽放,生命现: 喉咙开,蓝莲绽放,灵性现; 额轮开,紫莲绽放,智慧现: 顶轮开,千瓣莲花,彩虹现。 红十具象师,橙百具象师,黄千具象师,灰迷具象宗师,绿生宗师,蓝灵宗师,紫归宗师,彩虹尊者。 生命之花,如此璀璨,如果可以,我愿奉献!穿越大明 唐鼎本想做个游手好闲的败家子 奈何摊上了个败家爹 开局败光家产,欠债十万两,被诬造反 家里还有三个美貌娇妻要养活 唐鼎无奈支棱起来 开启亲爹养成计划。 贺影偶然得到可以封杀世界的秘密洞穴,等到贺影炼成天下无上的实力后,出来意外得到了个婴儿,从此贺影伪装成婴儿的父亲,待到婴儿长大后 本杂记是以心情日记书写的,元素分为古诗绝句、律诗,英文诗,现代诗歌,词曲,宋词以及散文。十五篇一轮回,变化多端,内容丰富。未来世界,人类科学家研究出了变异病毒。神魔乱,星落觉。在神奇的网游虚拟世界中,讲述着一位落寞青年,一往无前,披荆斩棘的逆世崛起之旅。从默默无闻,到名震万古,在恶与善,得与失之间,他会如何抉择。秦风被迫从游戏界龙头企业辞职后,加入了一家只有几个人的小公司。 制作游戏,我秦风还没服过谁。 看不起小游戏?《开心消消乐》《神庙逃亡》教你做人。 单机游戏没落了?仙剑系列,魂系游戏,剧情或难度,总有一款玩哭你。 网游模式单一?LOL,绝地求生,自走棋,这回不是打怪升级了吧? 就凭做游戏,也能做首富! 不信?做给你看!
天行渐 南靖武侠传 帝国第一纨绔 平常的人生 末世:绝望深寒 人工智能之傀儡大宗师 原境 大齐商人 天刀之九幽来客 请,停止进化 抚爱的折痕 凶宅诡事 类地行星468号 从城隍开始,地府我为尊 朱落星辰 大晋:我真不是天命之子 物种灭绝 我当天师那几年 赤星降临 封魔奇缘录 福地湖天气 蝴蝶和天气 朝阳天气. 合尔滨天气 福地湖天气 ?x坤湾天气 成都沟天气 霍山天气网 佛山天气温 禅堂天气 大连湾天气 朝阳天气。 关鹅沟天气 鸡西的天气 官额沟天气 国门天气 成都沟天气 佛山天气温 店远天气 宫庄天气 蝴蝶和天气 古拉天气 丹梭天气 广西年天气 鸡西的天气 关鹅沟天气 佛山天气温 丹梭天气 店远天气 佛山天气温 国门天气 蝴蝶和天气 哈地滨天气 宫庄天气 高庙镇天气 国门天气 管鹅沟天气 成都沟天气 关鹅沟天气 管鹅沟天气 国门天气 查松江天气 根西岛天气 朝阳天气。 广西年天气 蝴蝶和天气 大连湾天气 哈地滨天气 珙县的天气 常熟天气网 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 御天游龙传 龙陨时代 万古第一神 来自幻想世界的客人 定河山 欧博官网 亚星游戏官网 亚星官网 欧博官网 澳门葡京游戏官网 高庙镇天气 管鹅沟天气 福地湖天气 蝴蝶和天气 官额沟天气 朝阳天气. 朝阳天气. 古拉天气 管鹅沟天气 根西岛天气 绩溪的天气 哈地滨天气 长春今天气 大连湾天气 官额沟天气 合尔滨天气 朝阳天气。 古拉天气 丹梭天气 官额沟天气 根西岛天气 常熟天气网 常熟天气网 古拉天气 古拉天气 珙县的天气 根西岛天气 管鹅沟天气 合尔滨天气 霍山天气网