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
南宁至中山火车时刻表郑州一达州的火车票多少钱一公斤黄兴步行街去火车南站徐泾东到火车站威海至长沙火车票价南宁至中山火车时刻表网上买火车票能不能退票黄兴步行街去火车南站遵义西到天津火车梅州 到 长沙 火车时刻表向塘到丰顺火车站时刻表黄兴步行街去火车南站淮北到日照火车票向塘到丰顺火车站时刻表黄兴步行街去火车南站通辽去南昌火车枣庄西一上海火车票多少钱郑州三亚火车票价格威海至长沙火车票价无锡火车站到上海红桥火车站到杭州郑州三亚火车票价格遵义西到天津火车网络火车票直接进站宿州到常州普通火车票多少钱通辽去南昌火车遵义西到天津火车岳阳到苏州火车要多久时间表今天泉州到福州火车票查询无锡火车站到一个文明在逐渐消亡,必将有另一个文明在兴起。 人类在文明与文明之间生存繁衍,找寻着自己人生的意义----林尘做梦也没想到,给自己戴绿帽的女人不仅百般羞辱他,甚至还要抢夺他女儿的心脏! 对爱情彻底失望的他,更没想到,这世界上还会有这样一个女孩,愿意为他付出一切! 在那重重包围中,他鲜血淋漓。 我今天就要带走她,我看谁敢拦我!赵阳意外绑定可以往返现代与明末的传送门。 穿过传送门,对面是气势汹汹,向着他冲刺而来的八旗骑兵。 数次尝试都铩羽而归,赵阳直接上交传送门,与官方合作。 当官方看到赵阳展示的另一个世界后,整个大夏都为之轰动。 一个星球的资源,一个全新的未开发世界! 大夏官方第一时间下定决心,制定绝密计划,设置最高权限。 终于,再次踏入明末大地的赵阳。 身后,是一条蓄势待发的庞然巨龙……抽刀难断回忆的河,剪不断,理还乱,多少少年烦心事,都随时间去一个奇怪的梦,不同的神奇经历,在梦中冒险,体验不同的人生百态。当李谷来到第一个梦境中偶然获得了煞,李谷在拥有了煞后会进行怎样的冒险。星游在逃脱时空乱流后随机降落到了一个星球上,物资将尽的他喜出望外地勘测了一番,却发现这个星球上的生物正是追杀从而致使他落入时空乱流的相族的祖先…… “元姬,别拦我,让我炸了这个星球!” “可是……主人……我们已经没有能够摧毁星球的武器了啊……您忘了它们早就丢失在时空乱流里面了吗?” “那就再给我造出来……” …… 种田文(雾)现代反赌专家穿越到大明,睁眼便是生死局,满街皆是花样赌! ?骰宝、牌九、叶子戏,走狗、斗鸡、蛐蛐乐! 偷天换日、飞云探龙、?海底捞月、天外飞仙? ?林萧笑了:过家家的把戏,也好班门弄斧?要说起出老千这档子事,我会的远比你们梦寐以求的多得多! 《系统+策划》当你亲眼见证了那一个个怪诞的民间鬼故事的发生,当你看到一个个不为人知的角落所发生的离奇事件,你你还会相信无神论吗?亡灵降世,唤醒的是恐惧;教派逃避,引起的是分裂;帝国联盟,换来的却是勾心斗角。 25岁的少年魔术师,能否在这乱世中保持自己的初心,承担起那份振兴教派的责任,拯救更多受苦受难的人民,在强者林立的星万大陆中成神证道。 这个世界很冷,但也总有希望。 “蓝星保卫战一级将士贺华,恭送龙将军!” “伏羲舰队全体舰员…恭送龙将军!” 九九年蓝星保卫战一役在跨越时代的钟声和烟花中,伴随着第一批零零后的婴儿哭声蓝星赢来了新的纪元! …… 二十年后,一个男人从南极的最深处走出,他承载着九九年的绝大部分的过往给所有的蓝星人类带回一个巨大的秘密! “什么?” “九九年的外星保卫战他们战胜的只是先锋部队,一**炮灰…!” “时隔二十年,真正的入侵即将正式展开!” 人类危机存亡之际,原本“死去”二十年的伏羲舰队舰长龙五从南极最深处带着人类最后的希望走出! “我名龙五,龙的传人,武安天下!” “大厦将倾在即,愿挽天倾者随我一起…发起反攻!”
流星风暴 赛尔号之女皇驾到 百劫历 佘家沟 全球穿越:我能吞噬天赋 混元魔神体 诸天从武林外传开始 诡异直播实录 乾坤永续 剑眼 我就是大王 全能小兽妃冥王别太宠 人口时代 万古神尊 六国:起始 黑鸦之吻 重生全能系统天之骄子 一剑庙堂江湖远 最强仙帝在都市 这个剑神有点浪 西宁至大庆火车站列车时刻表 通辽去南昌火车 长春到江苏南京的火车 威海至长沙火车票价 郑州一达州的火车票多少钱一公斤 西安到延安 火车 长春到江苏南京的火车 岳阳到苏州火车要多久时间表 上海站到广东火车票查询 淮北到日照火车票 云梦一十堰火车时刻表 云梦一十堰火车时刻表 网络火车票直接进站 通辽去南昌火车 南宁至中山火车时刻表 宿州到常州普通火车票多少钱 长春到乌海市火车票 西宁至大庆火车站列车时刻表 上海虹口火车票购票点 黄兴步行街去火车南站 通辽去南昌火车 黄兴步行街去火车南站 上海虹口火车票购票点 郑州三亚火车票价格 梅州 到 长沙 火车时刻表 学生火车票提前多少天可以买 西宁至大庆火车站列车时刻表 上海虹口火车票购票点 上海虹口火车票购票点 上海站到广东火车票查询 威海至长沙火车票价 广通到峨眉山火车站时刻表 徐泾东到火车站 南宁至中山火车时刻表 网络火车票直接进站 宿州到常州普通火车票多少钱 徐泾东到火车站 长春到江苏南京的火车 网络火车票直接进站 三江口到北京的火车 宿州到常州普通火车票多少钱 岳阳到苏州火车要多久时间表 无锡火车站到 长春到乌海市火车票 向塘到丰顺火车站时刻表 广通到峨眉山火车站时刻表 云梦一十堰火车时刻表 宿州到常州普通火车票多少钱 学生火车票提前多少天可以买 枣庄西一上海火车票多少钱 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 老爷子和新物种 博弈传 大美宝鸡 从疯人院副本走出来的戏精 怀兰 百度 百度 百度 百度 百度 学生火车票提前多少天可以买 今天泉州到福州火车票查询 徐泾东到火车站 上海红桥火车站到杭州 上海红桥火车站到杭州 长春到江苏南京的火车 长春到乌海市火车票 郑州一达州的火车票多少钱一公斤 上海站到广东火车票查询 宿州到北京的普通火车时刻表 梅州 到 长沙 火车时刻表 枣庄西一上海火车票多少钱 威海至长沙火车票价 淮北到日照火车票 三江口到北京的火车 长春到乌海市火车票 广通到峨眉山火车站时刻表 上海站到广东火车票查询 上海站到广东火车票查询 遵义西到天津火车 上海红桥火车站到杭州 枣庄西一上海火车票多少钱 长春到乌海市火车票 今天泉州到福州火车票查询 西宁至大庆火车站列车时刻表 无锡火车站到 通辽去南昌火车 枣庄西一上海火车票多少钱 宿州到常州普通火车票多少钱 岳阳到苏州火车要多久时间表 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网