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
埃及和阿联酋度天气预报贵州武当天气天气阜新预报赣榆7天气报告赣榆七天天气预报15天埃及和阿联酋度天气预报新加坡天气预报小雨天气阜新预报贵阳市乌当区一周天气秦皇岛环境天气5月底西藏天气埃及和阿联酋度天气预报连云港冬天气温5月底西藏天气天气阜新预报秦皇岛环境天气北京房山百花山天气预报连云港赣榆未来七天天气预报连云港赣榆未来七天天气预报白川天气贵阳市乌当区最近天气连云港赣榆未来七天天气预报贵阳市乌当区6月份天气仙桃近一星期的天气预报赣榆七天天气预报15天毕节最近天气赣榆7天气报告西平专探天气预报深州天气查询连云港冬天气温 大千世界修真界,封神大战天门关,只因大地被破碎,大法祖师炼乾坤,结界之内难修仙,飞升天劫降,破界离去难复返。一个现代人到了古代会做什么。 裴尘对自己说: 如果这一切都是梦,梦醒时自然烟消云散。 如果这一切不是梦,那我要做的就是,好好活着,也让我身边的人,好好活着。 大周王朝,内忧外患,民不聊生,在这样的环境下,自己不愿随波逐流,想要改变。 事情要么不做,要么就做到极致。 纺织、制弩、黑火药、香皂、制盐、炼钢…… 一步一步的布局,一点一点的强大。 也有对喜欢人儿的心动、感动、冲动,以及对传说中武功的向往。 加入小黑屋全勤码字群,与群内好友一起加油码字为啥别人重生就风生水起,左拥右抱,我就得被抓去做大蛇丸的实验? 呸!打不过BOSS不要紧啊,那就再重生一次~ 呐,重生嘛,最重要的就是开心咯,你饿不饿,我煮碗面给你吃啊? 他,是魔教的长老,经苍梧城一战震天动地,却也耗尽最后一滴血,杀身成仁。死后,魂魄被吸进时间裂缝,开启了全新的生活和未知的道路~~~末日之乱三百年后,人类终于在异兽的铁蹄下重建安身之所。 陆香作为英雄之子,却在父亲死后沉迷书海,逃避现实。然而意外发现父亲或许不是死在异兽之手。 为了查明父亲死亡的真相,陆香终于踏上狩猎异兽之路。 然而真相或许比他想象中更加可怕,他们并没有在异兽口中的取得胜利,他们生活的世界或许只是一个巨大的牢笼罢了……一个人如果能够回到过去,他的人生是否会发生变化,答案或许是肯定的!那么他是否也能够改变他人的命运呢,如果也是,那么又能改变多少呢?叶荇的这个故事就从回到过去开始......虚弱的中一在墙角不甘的盯着眼前的一幕,东子倒在血泊中,老莫被一杆银枪钉在墙上,鲜血直流,一脸的死不瞑目!然而造成这一切的居然是她,一个和我一路走来,却也是要送我先上路的人……男护士转生异世界,竟然被职业评定选择成了最稀有职业-男性圣职者?本来以为可以在异界享受人生,迎娶公主,走上巅峰,没想到卷王居然就在我身边?内卷什么的之前已经受够了!为了对抗内卷,全都点了治愈,男圣职者平凡而又非凡的异世界生活,从现在开始!尘寰外,碧海中,桃花之间桃花岛。秋风起,海波兴,几度潮来听玉箫。且看东邪黄药师传人,如何纵横都市。满天神佛朝我跪拜,天下美女唯我独揽!已完本,放心阅读。
我们想说的话 可乐鸡可乐 修仙大佬重生异世界之旅 盅哥的强无敌 我什么时候可以心想事成啊 爸妈,我是你们亲生的吗? 开局:永动机反物质 空心飞天斩 大夏执剑人 天地参一 我的淘金之路 光与暗的黑龙翼 天渊辰 诡案法医神探 曙光之壤 末世魔潮 梦回三世去修真 黑渊术士 中州造神记 醉叙江湖梦 20172月连云港天气 林芝市八一镇天气预报 北京房山百花山天气预报 连云港赣榆未来七天天气预报 20172月连云港天气 明天仙桃什么天气 内蒙古库布齐沙漠全年天气 2017年2月连云港天气预报 毕节最近天气 连云港冬天气温 贵阳市乌当区6月份天气 贵阳市乌当区6月份天气 仙桃近一星期的天气预报 秦皇岛环境天气 埃及阿布扎比天气预报 赣榆七天天气预报15天 内蒙古库布齐沙漠全年天气 毕节最近天气 贵阳市乌当区最近天气 埃及和阿联酋度天气预报 林芝市八一镇天气预报 天气阜新预报 贵州武当天气 2016年12月稷山县天气 2017年2月连云港天气预报 仙桃近一星期的天气预报 毕节最近天气 贵州武当天气 贵阳市乌当区最近天气 毕节最近天气 连云港赣榆未来七天天气预报 林芝市八一镇天气预报 赣榆7天气报告 埃及和阿联酋度天气预报 仙桃近一星期的天气预报 赣榆七天天气预报15天 天气预报合江40天 内蒙古库布齐沙漠全年天气 仙桃近一星期的天气预报 天气预报合江40天 赣榆七天天气预报15天 连云港2月25号天气 白川天气 安徽涡阳天气预报48小时 2016年12月稷山县天气 林芝市八一镇天气预报 贵阳市乌当区6月份天气 赣榆7天气报告 深州天气查询 新加坡天气预报小雨 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 参见吾王 绝望书屋 天下第一卦 御灵逆天之旅 足球引路人 百家乐官网 澳门葡京官网 葡京官网 百家乐官网 万利游戏官网 赣榆七天天气预报15天 贵阳市乌当区一周天气 2017年2月连云港天气预报 仙桃近一星期的天气预报 仙桃近一星期的天气预报 连云港市二月份天气 连云港市二月份天气 秦皇岛环境天气 贵阳市乌当区6月份天气 新加坡天气预报小雨 西平专探天气预报 埃及和阿联酋度天气预报 2017年2月连云港天气预报 内蒙古库布齐沙漠全年天气 白川天气 连云港冬天气温 赣榆7天气报告 2017年2月连云港天气预报 秦皇岛环境天气 西平专探天气预报 西平专探天气预报 连云港冬天气温 连云港市二月份天气 林芝市八一镇天气预报 秦皇岛环境天气 新加坡天气预报小雨 内蒙古库布齐沙漠全年天气 贵州武当天气 天气预报合江40天 林芝市八一镇天气预报