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
一枚邮票的简介学生的邮票图片大全图片大全图片大全图片搜索中国人物普票邮票小狗邮票图片大全图片大全图片搜索阅读之美摇号邮票1978马邮票1一1多少钱牡丹邮票80分价格表中国人物普票邮票九十年建军邮票邮票可以自己做吗邮票背胶粘上东西了一枚邮票的简介南京大桥邮票图片大全书法邮票收藏价值中国人物普票邮票邮票可以自己做吗良渚玉器邮票简介邮票 千里江山图邮票 千里江山图2000年龙的邮票价格戊戌年特种邮票邮票 千里江山图九十年建军邮票50邮票价格是多少阅读之美摇号邮票永乐宫壁画邮票假小狗邮票图片大全图片大全图片搜索邮票特38金鱼盖销价格邮票一套邮折图片南京大桥邮票图片大全作者白菜,不好勿喷,谢谢浩瀚宇宙之中,地球文明之外,是否还有其他的文明?除了地球人之外,别的星球是否还有与地球人类似的外星人? 国家航天局在月球表面建造基地,用以科学探索,无意之中发现竟然有月球人存在,他们又是如何构造自己的文明?魏和平在迷茫中穿越到了平行世界,无意中发现了系统的存在,他该勇往直前,还是猥琐发育,我决定要安全的浪。这是一个关于跨时空给复仇的故事。 恶毒的地产商人为了逃避审判,制造了骇人听闻的火车惨案,主人公郑源父母双双在这次灾难中遇难,然而这样的通天大案竟然被压了下来,最后不了了之。 作为这次灾难中唯一的幸存者,在时隔50年后终于得知真相,他通过某种实验回到了30年前的世界,在这里他巧妙布局,一点一点揭露当初惨案的真相,最终将所有犯罪份子送上法庭。 21世界的凤凰男昊天不幸战死酒场,怨气冲天,魂魄不散,穿越重生到大草原,拯救昊氏于危难之中。 昊天运用在21世纪所学,带领昊氏统一大草原,进而逐鹿中原,建立王朝。破碎的竹简,修改历史。接续的断玉,破茧重生。华夏大地的历史一次又一次的变幻,究竟哪些是真哪些是假。穿越各大王朝,一个终极的秘密即将揭开。两个组织的碰撞,守护华夏历史的责任。待我将这一切缓缓道来。开局直接被动使女主疯狂晕倒,好狠的男主,竟不知道怜香惜玉,在主角成为所向披靡,有我无敌,杀遍九天十地的前提前,竞发生了这一样一事世间修行之法万千,体修,元修,剑修,魂修,血修,魔修,佛修……皆有移山填海,斗转星移之威能! 且看少年如何凭借肉身的极致,以力破万法,从一个被迫成为炮灰的底层修士,一拳一拳击碎所有阻碍,让诸天神魔臣服,直至登顶这无尽巅峰,成就不朽!剑未妥,江湖早,纵使不懂,也不默,少年啊,不归呀,吾辈皆是英雄! 鸟惊忽现白马,飘飘锦衣落梨花,少年呀,归来呀,千年谁复重生?一剑动京华!高考毕业生王阳在经历了高考落榜,女朋友劈腿之后,意外的发现自己的手机中多出了一个短视频APP《快音短视频未来版》。 “盛鼎新城发生火灾,截止到6月28日,警方已经证实,此次大火造成两死一失踪,死者为集团董事长苏轻雪,大厦保安下落不明。” 正当王阳准备删除这个扯淡软件的时候,发现事情居然真的如视频所说的发生了…… 王阳本来想凭借预知未来成为一个亿万富豪,却因为一次刺杀意外觉醒了异能【神赋】,并且卷入了一场执法局与暗夜教会的斗争中……
终焉之王 青城风云 我在异界守城池 漫威:漫画家也想拯救世界 混在NBA的奥斯卡影后 大秦:一剑开天门,被金榜曝光了 全民AR竞技 丧尸围城:我拥有终极魔典 我不想来大唐 少年时之九零后 鲛人游记 子夜出租 我一个魔修和正道联姻? 世界的真相,你了解吗? 巴别塔陨落 重生之问剑 三国,历史名将大乱斗 重生之我要当最强召唤师! 孤独见证人 烈火英雄之水中蛟龙 J92古代文学家邮票 邮票定制价格多少钱 良渚玉器邮票简介 邮票 千里江山图 J92古代文学家邮票 邮票成语故事图片大全 两分的邮票价格表 邮票是指什么地方 永乐宫壁画邮票假 南京大桥邮票图片大全 九十年建军邮票 杭州峰会纪念邮票册 50邮票价格是多少 邮票可以自己做吗 1978马邮票1一1多少钱 阅读之美摇号邮票 两分的邮票价格表 永乐宫壁画邮票假 戊戌年特种邮票 一枚邮票的简介 邮票定制价格多少钱 中国人物普票邮票 学生的邮票图片大全图片大全图片大全图片搜索 书法邮票收藏价值 邮票可以自己做吗 50邮票价格是多少 永乐宫壁画邮票假 学生的邮票图片大全图片大全图片大全图片搜索 戊戌年特种邮票 永乐宫壁画邮票假 阅读之美摇号邮票 邮票定制价格多少钱 中国长城邮票80分 一枚邮票的简介 邮票特38金鱼盖销价格 阅读之美摇号邮票 中国长城邮票80分 良渚玉器邮票简介 50邮票价格是多少 中国长城邮票80分 阅读之美摇号邮票 g20收藏邮票 2000年龙的邮票价格 杭州峰会纪念邮票册 书法邮票收藏价值 邮票定制价格多少钱 杭州峰会纪念邮票册 小狗邮票图片大全图片大全图片搜索 邮票一套邮折图片 牡丹邮票80分价格表 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 逍遥不记年 凡民成仙 浩辰仙缘 半踏长裙宛约行 乡村玄学大师 亚星官网 万利官网 百家乐官网 欧博游戏官网 欧博官网 书法邮票收藏价值 J92古代文学家邮票 J92古代文学家邮票 邮票可以自己做吗 邮票可以自己做吗 邮票 千里江山图 牡丹邮票80分价格表 g20收藏邮票 学生的邮票图片大全图片大全图片大全图片搜索 50邮票价格是多少 邮票背胶粘上东西了 南京大桥邮票图片大全 邮票成语故事图片大全 邮票可以自己做吗 1978马邮票1一1多少钱 书法邮票收藏价值 邮票 千里江山图 学生的邮票图片大全图片大全图片大全图片搜索 学生的邮票图片大全图片大全图片大全图片搜索 邮票定制价格多少钱 邮票可以自己做吗 阅读之美摇号邮票 书法邮票收藏价值 邮票是指什么地方 南京大桥邮票图片大全 杭州峰会纪念邮票册 2000年龙的邮票价格 阅读之美摇号邮票 永乐宫壁画邮票假 一枚邮票的简介