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
论文都是学术性的吗论文版面费是什么论文都要问卷调查吗论文独创声明模板论文对教育法的认识论文都是学术性的吗论文封面的日期论文都要问卷调查吗论文附录怎么加论文发表类型论文对学生的重要性论文都是学术性的吗论文发表指导论文对学生的重要性论文都要问卷调查吗论文发表类型论文封面日期大小写论文对教育法的认识论文对教育法的认识论文定稿指导教师意见论文改重软件免费论文对考研影响吗论文附录怎么加论文顶端logo和页码论文对奥运会的意义论文版面是啥论文独创声明模板论文调查报告调查方案论文定稿指导教师意见论文范文家乡美少年李宽本是李家一个低等的奴仆,却因为一次奇遇走上了修炼的道路。身陷囹圄,陆抗得天魔本源相助,逃出生天。 没有灵根,陆抗以血祭之法强行开辟,从此修行得道。 修行魔道,却不为恶,妄称正义之辈莫坏我自在逍遥。 偶行善事,自诩邪恶之徒莫言我虚假仁义,阻我大道朝天!提瓦特大陆是一个有着七神统冶的七个国度,但换来这一切和平的,也正是二千年前的一场魔神大战。七神和创世神辰一起打败了魔神,换来了所谓的和平。而随着旅行者的到来,创世神辰的二十一条预言也慢慢开始服出水面。提瓦特大陆将再一次面临一场大的阴谋。 亲亲苦苦熬到大学毕业,李风一夜猝死,到了三万大千世界当起了编程员。 出身宗门世家,他小手轻轻一敲,世家子弟直接名望千里之外。 出身九阴之体,他小手一改,顺便捡到了包罗之象。 出生有黑鸦陪同,他手一挥,三千万凤凰卧地朝拜。 一日,李风发现,他可以直接编写自己的修为,无限制。 一日,李风发现,他还可以直接编写别人的修为,无限制。 又一日,李风发现,这个后台竟有一个更大的秘密。比如:编写一切圣灵,更改一切数据! 三个月后,李风成为天道正式编程员。 在强兵压城的某个夜晚,李风一个“手滑”,直接将敌方五百万大军修为下降两阶! 不够?那就给我再降! 不请自来的客人,盯上我们生存的泡沫宇宙。将我们视为棋子,玩弄生命存在的真理概念。 有人说元气复苏即是毒药也是机遇。也是一个席卷整个世界诱饵。 不要修行,不要修行。源头充满大恐怖。 所有在迷雾中摸索的人,都会感染到充斥着死寂不祥气息。阴风灭世,十殿阎罗转生,天庭诸神灭亡,大势之下,谁才是救世主,看我灭尽阴风一家人的命运因为一个孩子就此改变!这个世界有修行者 谷令君:无妨,老子有千军万马! 这个世界的修行者,可万军之中取上将首级 谷令君:无妨,老子会造火枪火炮! 这个世界…… 谷令君:聒噪!任你是集天元气于一身的大修行者,也抵不过老子的一门大炮! 啥? 没炸死?再补一炮!穿越到大丰界的秦风,本以为能够成仙问道,潇洒过一生。但没想到自己身中火毒,只剩两百年的寿命,算了,该吃吃,该喝喝,按部就班就好,道——不可强求。主角再世重生,得神植;平末日;斩仇敌;护佳人。 法盘开道;神兽傍身;游历万界;直至巅峰,成就不死不灭神。
王之起点 看那一弯新月 创神造梦录 异瞳:神豪从鉴宝开始 帘幕之下 直播,我哥是修仙者 海贼之无敌后才开始签到 术门大劫:不灭雷霆 谁是少年,谁不狂 苟之道 阳星历 朗挈名单 无有善 我以诗词问长生 神医王婿 穿入木星大陆的修者 无人生还之迷雾森林 镜中行 这神秘一点都不神秘啊 华夏人,华夏魂 论文版面费是什么 论文发表类型 论文封面日期大小写 论文对教育法的认识 论文版面费是什么 论文保存用什么格式 论文封面日期格式要求 论文发表与见刊区别 论文保存用什么格式 论文发表指导 论文附录 是否查重 论文附录 是否查重 论文顶端logo和页码 论文发表类型 论文都是学术性的吗 论文对奥运会的意义 论文封面日期怎么写 论文版面是啥 论文版面费是个人账户 论文都是学术性的吗 论文发表qq群 论文都要问卷调查吗 论文版面费是个人账户 论文对考研影响吗 论文发表图片处理 论文定稿指导记录 论文版面是啥 论文版面费是个人账户 论文改重软件免费 论文版面是啥 论文对教育法的认识 论文发表qq群 论文独创声明模板 论文都是学术性的吗 论文顶端logo和页码 论文对奥运会的意义 论文独创声明查重红色 论文封面日期格式要求 论文顶端logo和页码 论文独创声明查重红色 论文对奥运会的意义 论文发表与见刊区别 论文定稿指导教师意见 论文封面日期怎么写 论文对学生的重要性 论文发表qq群 论文附录 是否查重 论文对奥运会的意义 论文定稿指导记录 论文封面的日期 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 放我一马如何 信念之甲:平行世界的故事 货车陪我一起闯天涯 梦回大宋之我是宋太祖 元宇宙:大敌当前 欧博官网 亚星管理平台 澳门葡京游戏官网 欧博官网 亚星游戏官网 论文独创声明查重红色 论文都是学术性的吗 论文对奥运会的意义 论文版面费是个人账户 论文保存用什么格式 论文版面是啥 论文对学生的重要性 论文独创声明模板 论文对学生的重要性 论文封面日期格式要求 论文封面日期怎么写 论文对学生的重要性 论文定义重复 论文封面日期怎么写 论文改重软件免费 论文附录怎么加 论文发表指导 论文发表图片处理 论文版面费是什么 论文独创声明查重红色 论文对奥运会的意义 论文独创声明模板 论文调查报告调查方案 论文封面的日期 论文附录 是否查重 论文顶端logo和页码 论文定稿指导教师意见 论文顶端logo和页码 论文发表类型 论文定稿指导记录