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
新宁到广州汽车票锦州到南通汽车站时刻表新宁到广州汽车票金秀到来宾的汽车时刻武昌到漳州汽车时刻表查询昆明市长途汽车站电话恩施到海口汽车时刻表查询新宁到广州汽车票韩城至三门峡客运汽车站洛阳天鹰汽车站地址沧州到嘉兴汽车时刻表查询电话新宁到广州汽车票张家口到定州汽车刻表海口至长沙汽车莆田到镇江丹阳的汽车站时刻表洛阳天鹰汽车站地址汾阳到榆次汽车站时刻表威舍到盘县的汽车威舍到盘县的汽车松溪至温州汽车江阴宁波汽车时刻表查询威舍到盘县的汽车韩城至三门峡客运汽车站安柴到东营汽车电话武昌到漳州汽车时刻表查询牡丹江到鸡西的汽车票金秀到来宾的汽车时刻安柴到东营汽车电话松溪至温州汽车张家口到定州汽车刻表“我不后悔,因为无论怎么选,最后都会后悔。”不知为何,我重生到初三的那个暑假,既然回来了,我就不会辜负这个机会末世+自然灾害+无系统+求生 气候突变,打破了世界原有的平静,冰川时代降临,幸存者挣扎求生。 面对未知的灾难和危险,一个个小人物组建到一块,共度危机,只为在这末世之下,走的更远宋徽宗时期宣和三年七月上旬,以张叔夜、张伯奋、张仲熊三人为首的三十六部雷将,十八位散仙团灭了梁山!这件事很快传到了天庭,天庭玉皇大帝立刻派观音菩萨从披香殿内释放了新一波的天罡地煞星下界聚义黑牙泊给宋江等一百单八将报仇,而玉帝不放心新一波下界的一百单八将便又派出十二星座战士和十八罗汉将军下界聚义红日山为黑牙泊好汉助阵!最终黑牙泊一百单八将和红日山好汉的配合下团灭了张叔夜一伙雷将,为宋江等一百单八将报了仇雪了恨苏铭带着系统来到平行世界,却意外和当红女星沈雨萱有了一夜绯闻。 什么!沈雨萱居然还是苏铭的头号黑粉! 苏铭写小说大火。 沈雨萱:“什么破小说,写得狗屁不通。” 苏铭写歌大火。 沈雨萱:“什么破歌,一点都不好听。” 苏铭导演的电影大火。 沈雨萱:“什么破电影,狗都不看。” …… 夏目瑶:“你这么讨厌苏铭,我可以让他做我男朋友吗?” 沈雨萱:“不行,他是我的!” 苏铭:“……”我和我的愛人生活中的小事 “超前科技解决不了的对未知恐惧。” 在这日新月异的时代,仰望着如同深渊的星空,眼内是无尽的疯狂混乱。 模拟出最亲人的模样,内心却冷地可怕。身患人格模拟症不停寻找真我的自己,在魔法与科技交融的奇迹夜世界,奏鸣一曲专属旧日的圣歌。资深外科医生林陨,莫名穿越到九州大陆的玄月宗,成为了最被人看不起的一名上门赘婿,同时也拥有了一位美若天仙的宗主妻子。 幸得药神系统,无限速成神品丹药,修得上古肉身成圣之法。从此扭转悲惨命运,脱胎换骨! 阴谋毒害、冷眼嘲笑……一切都将成为过去。 纵横万古帝之道,我自剑来谁言轻? 哪怕是当赘婿,他也要当一名最强最狠的赘婿!现代修仙小说,不写狗血剧情,绝对完美结局。富士山喷发?小日子沦陷?全球灵气复苏?人人可修行?当飞机撞上了御剑飞行,当轮船碰上了水上漂,当汽车跑不过人,这是道德的沦丧还是人性的扭曲?欢迎走进高武世界,一探究竟!!!年轻而又漂亮的律师周敏通过结婚妄想甩开过去而从头开始。过去的秘密如影随形。 周敏接了一起新的案子,却又莫名的被委托人吸引着。一个被控杀人的嫌疑人。周敏开始相信委托人的说法,不过他是否真的无罪呢?
大夏之江湖风云 怪物大师 错位时空 不正常式生活 天才的异世界之旅 秘法:从入门到贤者 我老婆是只黄皮子 美人小村医 道门幸存者 六国:起始 心之所向,素履以往 从天王开始的练习生 绝命人 火影之开局获得侠岚卦印 无情之驭 我在修仙界有百万粉丝 当代守夜人 情愫尸缘 最强精神病! 万物源流 邪道圣人 威舍到盘县的汽车 锦州到南通汽车站时刻表 昆明汽车南站的地址 杭州至德州汽车时刻表查询系统 武昌到漳州汽车时刻表查询 沧州到嘉兴汽车时刻表查询电话 昆明汽车南站的地址 牡丹江到鸡西的汽车票 海口至长沙汽车 福州 香港 汽车多久时间表 新宁到广州汽车票 新宁到广州汽车票 洛阳天鹰汽车站地址 锦州到南通汽车站时刻表 张家口到定州汽车刻表 杭州至德州汽车时刻表查询系统 昆明市长途汽车站电话 威舍到盘县的汽车 金秀到来宾的汽车时刻 郑州到济南汽车要多久 锦州到南通汽车站时刻表 郑州到济南汽车要多久 金秀到来宾的汽车时刻 韩城至三门峡客运汽车站 杨陵到铜川汽车 洛阳天鹰汽车站地址 威舍到盘县的汽车 金秀到来宾的汽车时刻 金秀到来宾的汽车时刻 海口至长沙汽车 杭州至德州汽车时刻表查询系统 江阴宁波汽车时刻表查询 汾阳到榆次汽车站时刻表 张家口到定州汽车刻表 甘泉县到西安汽车 东莞汽车北站图片 汾阳到榆次汽车站时刻表 昆明汽车南站的地址 甘泉县到西安汽车 恩施到海口汽车时刻表查询 东莞汽车北站图片 牡丹江到鸡西的汽车票 郑州到沛县汽车 昆明市长途汽车站电话 海口至长沙汽车 甘泉县到西安汽车 杭州至德州汽车时刻表查询系统 金秀到来宾的汽车时刻 建湖到合肥的汽车号码多少 恩施到海口汽车时刻表查询 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 末日凑数的日子 从崩碎九洲开始见证无敌 荒村游记 无处寻梦 将乡 百度 百度 百度 百度 百度 铁路能托运汽车吗? 甘泉县到西安汽车 昆明汽车南站的地址 恩施到海口汽车时刻表查询 威舍到盘县的汽车 昆明市长途汽车站电话 锦州到南通汽车站时刻表 汾阳到榆次汽车站时刻表 东莞汽车北站图片 张家口到定州汽车刻表 郑州到济南汽车要多久 洛阳天鹰汽车站地址 昆明汽车南站的地址 金秀到来宾的汽车时刻 恩施到海口汽车时刻表查询 江阴宁波汽车时刻表查询 洛阳天鹰汽车站地址 东莞汽车北站图片 海口至长沙汽车 锦州到南通汽车站时刻表 郑州到济南汽车要多久 昆明市长途汽车站电话 昆明汽车南站的地址 汾阳到榆次汽车站时刻表 东莞汽车北站图片 常宁至邵阳的汽车站时刻表 锦州到南通汽车站时刻表 杭州至德州汽车时刻表查询系统 松溪至温州汽车 铁路能托运汽车吗? 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网