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
心目中的美景作文300字写班里好人好事的作文写儿童节的作文450字心想的乐园作文小学英语作文我的小猫心目中的美景作文300字小学应用文作文写儿童节的作文450字校园欺凌的危害的作文写校园好人好事的作文400字偕老家小狗的作文写儿童节的作文450字新概念作文奖项小学英语作文写格式校园里的树高中作文写校园好人好事的作文400字写周恩来的小学生作文小学生写友谊的作文600字小学生写友谊的作文600字新概念作文大赛奖项写人的最好的作文小学生写友谊的作文600字校园欺凌的危害的作文校园里的记忆200字作文小学英语作文我的小猫小学生低年级读书作文小学生写人作文怎么教校园里的记忆200字作文新概念作文大赛奖项新概念作文奖项三国-争霸-(本故事纯属虚构,如有雷同,纯属巧合,请勿模仿。) 穿越东汉末年。 听闻:子龙一身是胆,却做保安队长? 据说:吕布死后,关羽看谁都是插标卖首尔? 传言:杀人屠城真英雄?携民度江伪君子? 众多迷题,静待卫鹰为你一一揭秘。 至于网传曹魏那点偏爱,东吴那点喜好? 卫鹰表示:“小孩子才做选择题,成年人自然都要。” 他闭上了现世的眼睛,在来世睁开,是否能看透黑暗的迷雾,不在异域迷失自己? 他穿越到火山魔法学院,一个穷困潦倒,没有攻击技能的废物身上,无意间的一个举动,得到了一只智商很高,能跟人沟通的猎犬。 在它的帮助下,得到法宝恶魔心索,成为了各大势力竞相收买的红人。 俗话说的好,花无白日红,人无千日好,正当他即将步入人生巅峰的时候,意外出现了…… 十字路口,他将何去何从?二次穿越的异世界勇者与他的伙伴接受神谕来到了一个被诅咒的世界,一个未知神灵祈求他们解除世界的诅咒,拯救世界。在经过一系列的金牌猎魔人的杀人事件中,勇者一行人逐渐找到了诅咒的源头,并得到了想得到的答案。   拥有冥界权能的金牌猎魔人突然开始大肆残杀人类,并与异世界的勇者们相遇。异世界的勇者们认为诅咒的来源就是这位金牌猎魔人,他们为了阻止他残杀人类,分布世界各地追捕这个猎魔人。永恒真神经过背叛,重生蓑衣寻马三千刹,一剑不断九州寒。江湖路慢,少侠,何不饮酒停马,回看江湖......原本天赋异禀的凌云,因为先天经脉堵塞无法修炼,被人推入山谷却因祸得福进入秘境得到高人传承打破身体桎梏,一代天才就此回归!神阶强者为傀儡,神兽为坐骑,神女为妻妾。且看凌云如何在这强者如云的世界一步一步走向巅峰!绝世狂龙重出牢笼,横行四海。 翻手为云覆手为雨,万千枭雄沉浮脚下,都市人杰退避三舍,敌国精锐消声灭迹,各方势力偃旗息鼓。 娶女战神为妻,灭敌手于江湖,驰骋官商两界,山高人为峰,世间我为王。拥有一扇两界门,可以自由出入影视的时空! 随后他发现,他已经成了诸天最大的敌人! 公元前475年,百家争鸣,群雄争霸,烽火狼烟,生灵涂炭! 道家学派弟子玄凌绝、顾北辰等人为躲避战乱归隐深山... 玄凌绝因天资聪慧,参透道家心法,欲悟道成仙! 正值瓶颈之际,惨遭误入魔道的顾北辰巧言暗算,被上界道祖老君制裁。 玄凌绝意志不死,寄意念于不朽的残发,不死不散... 他能重生的唯一途径就是依靠他的后世晋小刀,通过传授晋小刀道法,让其助自己意念化形,重生飞仙! 公元2020年,玄凌绝找到了晋小刀并融入到他的梦境,梦魇就此诞生...这是一个关于娱乐圈里爱情长跑的故事。当剧本人生里的龙套遇上了他人生与剧本里的女神时会产生什么样的化学反应和故事?这故事有点搞笑有点猥琐,有点伤痛也有点感动!
出色魔术师不是魔术 我是大宦官! 华夏神坻 异界:我成神了? 剑之遥 潜龙帝帅 封神之铁血艳影 古国传说 天命之灵 生活随笔之二 仰慕星空 龙魂战神:我的胸口有条龙 圣源之界 飞狼野游队 我要抓妖精 回到明朝当藩王 仙穹彼岸 无限穿梭世界的我掌控一切 我的世界海中宫殿 网游之剑灭诸神 写妈妈的特点的作文400字 写关于电脑的英语作文 写周恩来的小学生作文 小学英语作文我的小猫 写妈妈的特点的作文400字 小作文350字图片 写周恩来的小学生作文 小学生奇妙作文评语 小学生低年级读书作文 新职业的英语作文 校园欺凌的危害的作文 小学作文我真的佩服 小学生如何上网作文300 写关于电脑的英语作文 心目中的美景作文300字 小学英语作文我的小猫 写自己成长经历的作文 小学生低年级读书作文 写作特点 英语作文 写儿童节的作文450字 写关于电脑的英语作文 校园里的树高中作文 写班里好人好事的作文 小学英语作文写格式 写校园好人好事的作文400字 小学生如何上网作文300 小学生低年级读书作文 写班里好人好事的作文 写作特点 英语作文 小学生低年级读书作文 小学英语作文我的小猫 偕老家小狗的作文 心想的乐园作文 心目中的美景作文300字 校园里的记忆200字作文 小学英语作文我的小猫 心想的乐园作文 写周恩来的小学生作文 小学生如何上网作文300 校园里的树高中作文 小学生写人作文怎么教 新职业的英语作文 小学生山桃花的作文 写自己成长经历的作文 小学英语作文写格式 写关于电脑的英语作文 小学作文我真的佩服 小学生写人作文怎么教 小学生如何上网作文300 小学应用文作文 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 烟雨大唐 长城一号 武神魔心 超品枭龙 天道外卖员 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 新职业的英语作文 小学生奇妙作文评语 心想的乐园作文 写班里好人好事的作文 校园里的记忆200字作文 小学生写人作文怎么教 小学生写友谊的作文600字 小学生写人作文怎么教 小学作文我真的佩服 小学英语作文我的小猫 写关于电脑的英语作文 写周恩来的小学生作文 写儿童节的作文450字 新概念作文大赛奖项 小学生奇妙作文评语 写人的最好的作文 写妈妈的特点的作文400字 写班里好人好事的作文 小学生作文审题问题 校园里的树高中作文 小学生写友谊的作文600字 写妈妈的特点的作文400字 写周恩来的小学生作文 小学生作文审题问题 新概念作文大赛奖项 写周恩来的小学生作文 校园欺凌的危害的作文 校园里的记忆200字作文 校园欺凌的危害的作文 写关于电脑的英语作文