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 as part of Bootstrap is a 940px-wide, 12-column grid.

It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.

<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

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="span12">
    Level 1 of column
    <div class="row">
      <div class="span6">Level 2</div>
      <div class="span6">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>
Variable Default value Description
@gridColumns 12 Number of columns
@gridColumnWidth 60px Width of each column
@gridGutterWidth 20px Negative space between columns
@siteWidth Computed sum of all columns and gutters Counts number of columns and gutters to set width of the .container-fixed() mixin

Variables in LESS

Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.

How to customize

Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.

Staying responsive

Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to customize the grids in responsive.less.

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>

Responsive devices

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: 768px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 980px) { ... }
// 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 hidding 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

Test case

Resize your browser or load on different devices to test the above clases.

Visible on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop

Hidden on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop
阿凡达女主最新电影我心爱的小提琴丢失了电影夜来香电影下载电影新青年最后一期结果城市规划方面电影观后感丧尸电影 西瓜影音电影全家福演员表夜来香电影下载密爱相关电影农夫网电影赵子岳电影全集阿凡达女主最新电影中国女追男的电影红舞鞋日记电影夜来香电影下载农夫网电影一代枭雄曹操电影王佐电影拉拉电影王佐电影拉拉电影死亡地带电影迅雷电影 平原枪声 女演员王佐电影拉拉电影密爱相关电影带荒字的电影城市规划方面电影观后感桃色什么的电影电影新青年最后一期结果徐峥所有电影四字电影有哪些中国女追男的电影原本生活在21世纪的阿明,他是一位生物学家,在日常研究的过程中,他发现有一种奇特中药提取物可以长生不死,而且可以自由穿梭宇宙的超能力,还可以感知多为空间的生物。他在某一时间,偷偷地尝试了,瞬间来到了多为空间,那里的领导者将他关了起来,允许他4040年回到地球,故事也就从他被释放开始,不过,被释放的阿明也被赐予了“光明上古大神”的封号,主管地球、月球、火星..........古老泛黄的竹书缓缓展开,坟冢里锈迹斑斑的金文破土,刀笔小吏在汗青上镌刻着你方唱罢我登场时代,一个晦涩古语,一个被刻意隐瞒的真相,一曲鲜血淋淋的悲歌,从苟有所见地只言片语中露出历史狰狞的一鳞半爪。 一个穿梭时空的游子,来到采诗官手执木铎风雅颂的修仙时代,来到这礼崩乐坏的时代,来到这是气吞山河的时代,刀戈剑戟纵横捭阖,权谋暗影喋血朝堂。 在漫漫长夜中,他是否在殿堂的庭燎光中寻找到失落的曙光。 夜如何其?其夜未央。 夜如何其?其夜未艾。 夜如何其?其夜乡(向)晨!大褚,绍清十年。 妖邪诡祟肆虐人间,儒释道三教鼎立天下。 世间修者纵横,欲夺天地之气运,觅长生之无极。 陆宴清异界魂穿而来,却被告知仅有一天可活,后意外发现所谓的儒术竟是古诗! 侥幸活命的他本想悠闲的过上自己的小日子,却被不断卷入一个个风暴之中……  一个饱受世间疾苦的灵魂,来到了修真界,有了全新的名字,全新生活,还有属于自己的传奇。 “希望你下辈子有个精彩的人生。” 王磊“嗯,修真界的生活真刺激。” 漫天风沙,我于中独站女同桌重生了,说她未来是我老婆。 因为嫌弃未来的我穷苦潦倒,她决定用重生的buff帮我走上人生巅峰!   璃阳境内,有座小神山,小神山里,有个仙缘洞,洞府有位仙家,名叫武生。   小神武生,他是位阵法大咖,远近闻名。   仙缘洞的水池,灵雾缥缈,杨柳依偎,朵朵青莲,栩栩如生,漂浮在池中央。   池中的鱼儿莫不惬意,在池中游来游去,忽而三三两两跃出水面,“咚”栽回池中。   一朵青莲上,一只可爱的小兽,正在呼呼大睡,每当呼吸间,它小小鼻子上的泡儿,忽而大了,忽而小了,被升腾的灵雾,一触就破。   一派仙家的洞天福地,莫不如此。   ……   武生之前是凡人,他没有期望自己能够修仙,因为修仙在凡人的眼中,不过是奢望,永远无法实现的愿景。   后来,武生在这个不起眼的角落,无意中得到了一份仙缘。那么他武生,从此顺其自然的,踏上一条——求长生、搏机缘、证仙问道的征程。  天生至尊,为人族斩妖除魔!护人族万垂不朽!江宇泽前世遭兄弟的反水,亲朋的质疑,爱人的背叛,不幸陨落。烟消道散之时,竟发现在这大千世界之中,源灵大陆只不过是一粒尘埃。万年后得以重生,挖掘新的力量,开创新的规则,以源灵大陆为基础,向未知探索!三年前,剑宗第一天才叶雄为了承诺,隐瞒身份入赘到落魄王朝林家。 三年后,林王驾崩,林萱继位,世界暗潮涌动。魔族蠢蠢欲动,各方势力开始扩张版图,林家岌岌可危。 叶雄手持天罚,夺城池,杀魔物,战万兽,“林萱,我会为你斩在一条女帝之路。” 曾经统治所有大陆的巨龙帝国已经走向没落,在这个巨龙陨落的时代,旧秩序走向崩溃,新的秩序尚未形成,在一片混沌的世界之中正发生着各种各样的故事。
女校那点事儿 重生:火热1990 孤勇者的灵界 宗门里连我都是卧底 民进禁忌杂谈 无名之辈:巨石之下 道灵纪 海贼里的傀儡之剑 神的主宰:混沌世界 天朝之变 文明继承者 高冷大明星是我女友 一介布衣 穿越南北朝之寻秦记 帝落星辰 流言飞语 云门弃少 围子八仙群英传 班上不说话的怪同学 魔噬三十载狂少笑傲归来 带荒字的电影 老电影喜剧片锦上添花 一个道士有个镜片的僵尸电影 农夫网电影 带荒字的电影 死亡地带电影迅雷 电影 平原枪声 女演员 电影全家福演员表 四字电影有哪些 如此爹娘电影 过失传播色情电影 过失传播色情电影 阿凡达女主最新电影 老电影喜剧片锦上添花 电影新青年最后一期结果 城市规划方面电影观后感 如此爹娘电影 桃色什么的电影 电影 平原枪声 女演员 阿凡达女主最新电影 赵子岳的电影 夜来香电影下载 我心爱的小提琴丢失了电影 红舞鞋日记电影 农夫网电影 带荒字的电影 桃色什么的电影 我心爱的小提琴丢失了电影 电影 平原枪声 女演员 桃色什么的电影 城市规划方面电影观后感 赵子岳的电影 一部电影 找人帮生孩子 阿凡达女主最新电影 徐峥所有电影 城市规划方面电影观后感 一部电影 找人帮生孩子 一代枭雄曹操电影 带荒字的电影 一部电影 找人帮生孩子 城市规划方面电影观后感 有部电影叫彤彤 死亡地带电影迅雷 耍流氓的电影 红舞鞋日记电影 赵子岳的电影 耍流氓的电影 电影新青年最后一期结果 四字电影有哪些 电影全家福演员表 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 平平淡淡的我重生啦 末日,等不到的黎明 重生异世 我要不断进化 遑华录 无良河神 亚星官网 万利官网 欧博游戏官网 亚星官网 AG真人 王佐电影拉拉电影 赵子岳50-60年代电影 我心爱的小提琴丢失了电影 带荒字的电影 赵子岳的电影 桃色什么的电影 老电影喜剧片锦上添花 死亡地带电影迅雷 一个道士有个镜片的僵尸电影 王佐电影拉拉电影 王佐电影拉拉电影 过失传播色情电影 桃色什么的电影 密爱相关电影 死亡地带电影迅雷 郑爽主演的电影 城市规划方面电影观后感 夜来香电影下载 中国女追男的电影 带荒字的电影 赵子岳电影全集 电影全家福演员表 城市规划方面电影观后感 电影 平原枪声 女演员 有部电影叫彤彤 王佐电影拉拉电影 四字电影有哪些 我心爱的小提琴丢失了电影 过失传播色情电影 耍流氓的电影