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
蚌埠七月份天气安徽蚌埠7月5号天气蚌埠市3月份天气情况蚌埠市6月份天气蚌埠市7月天气蚌埠七月份天气2016年绩溪县天气蚌埠市3月份天气情况武汉天气2017年10月份武汉市2016年10月天气情况四川成都青白江区天气蚌埠七月份天气绩溪天气5月1天气预报四川成都青白江区天气蚌埠市3月份天气情况武汉市2016年10月天气情况234天气网预报蚌埠市7月天气蚌埠市7月天气罗利冬季天气温度新奥尔良10月天气预报蚌埠天气7月份天气统计武汉天气2017年10月份安徽绩溪天气预报一月份蚌埠市7月14号天气预报安徽绩溪三月天气蚌埠市6月份天气安徽绩溪天气前一周的天气罗利冬季天气温度绩溪县3月份天气我打碎了夕阳,夕阳要我赔偿,予我万般红尘,于此间水主沉浮. 大风泱泱,冒险即将启程,且看少年郎再次无双殿掀起新波澜小小侍郎,一朝得志,只手遮天,鸡犬也能升天,导致江山风雨飘摇。 堂堂王子,韬光养晦,忍受欺凌,只为等待黄袍加身那一刻。 不问苍生,迷恋长生,皇帝一心想修炼成仙,羽化飞升。 江山风雨飘摇,妖魔鬼怪难分,酝酿着偷天换日的滔天阴谋。 谁为正道?谁为邪魔? 从来英雄难过美人关,英雄为谁护花?美人为谁心悦? 有人的地方,就有江湖,朝野是权力场的江湖,步步为营、如履薄冰,武林是名利场的江湖,热血冲杀,义盖云天,江湖路上,从来都是腥风血雨。 叶飞流躲在家里偷偷的修仙,对外谎称在家写小说。 别人都不知情,直到某一天,为了救邻居家的小孩,叶飞流一只手拦下冲撞过来的一辆货车。 全村都震惊了。 从此以后,叶飞流带着叶家全族修仙。 十年后,世界与异空间融合,无数外域异兽入侵,一夜之间,全球陷入绝望之中。 就在这个时候,叶家全族挺身而出,御剑飞行,抵挡异兽洪流。 举世震惊! 外国:“天啊,龙国怎么会有那么强大的人。” “我为什么没有生在龙国?!” “啊啊啊,龙国人好幸福,他们有叶家。” PS:土豆出品,必属精品(嘿嘿)! 我叫牧冬,我的世界存在着一种名叫天劫的怪物,幸好,与此同时,有一群正义的超级英雄们挺身而出,与之对抗...... 直到那天,这个游戏出了BUG,不再自动刷新和删除记忆。“师傅,快来呀” “别跑,看着点脚下” 师徒两个走在山间,欣赏着秀丽山河,眺望远处的日落。上古圣战,天现裂象,神州大地分崩离析,无数碎片散落宇宙化作万千小世界。 数百万年后,一名渔村少年意外踏上修仙路,是机缘巧合还是命运使然? 在这个神魔并立,人妖共存的世界,且看他如何一路披荆斩棘,步步飞升。刚准备重生的林墨被系统判定为极其危险的罪恶灵魂,不但拒绝与其绑定,还把他关进了系统空间,这一关就是一千年。 但林墨精神本来就有点问题,而且是个冷血杀手,他在系统空间里没有崩溃自杀,而是找到办法偷学了系统所有力量,最终打破空间。 出来的第一件事当然就是把系统的本体拽出来殴打一顿! 但一码归一码,偷学了系统的力量,也算是和系统完成了绑定,重生到了一个异界大陆的林墨必须要负担起赏善罚恶的重担。 而这对于林墨来说,是一件相当痛苦的事。 自己练笔随笔安放之处一个公布于天下,被豪门家族抛弃的弃子。另一面却是玩世不恭的纨绔少爷却忍辱入了赘婿,然后如何转变 创造他的商业传奇。。。。。 本文描写一对乡下的老夫妻,一起过着平凡的而甜蜜的生活,苦中作乐,为了能够购买到一辆5000元的三轮车而,老两口不断去努力种地挣钱的故事。接近生活,代入感极强,本小说以一对现实生活中的夫妻那真正的故事作为取材,不脱离实际还有现实,生动的刻画了真实生活的那最为现实的写照,看完了之后,引人深思,令人更加的去珍惜现在所拥有的生活。趁您的亲人好友还在人世,多多珍惜,生活,那是最为苦涩而甜蜜着的。
弥留的通晓之刻 叶倾仙的传说 封澜传 女派修仙,师傅您轻点打 天横变 第二世:上帝的节目 特编第一作战连 我的眼睛一仙一魔 你听过吗? 霜冻烛炉 超神御兽师 雾似 玄幻:我能捡属性变强 斩神杵 圣龙图腾 剑仙独行 巴别塔陨落 造神局 我夺舍了我的尸骨 夜雨香 安徽绩溪三月天气 武汉市2016年10月天气情况 234天气网预报 蚌埠市7月天气 安徽蚌埠7月5号天气 安徽绩溪天气前一周的天气 3月底蚌埠天气一般多少度 绩溪上周天气预报 安徽绩溪天气15天天气预报15天查询 绩溪天气5月1天气预报 辽宁龙王庙天气预报 辽宁龙王庙天气预报 安徽绩溪天气预报一月份 武汉市2016年10月天气情况 蚌埠七月份天气 蚌埠市7月14号天气预报 3月份绩溪天气 安徽绩溪三月天气 新奥尔良3月中旬天气 蚌埠市3月份天气情况 武汉2017 10月天气 蚌埠市3月份天气情况 新奥尔良3月中旬天气 蚌埠天气7月份天气统计 武汉市2016年10月天气预报 昆明牟定天气预报 安徽绩溪三月天气 新奥尔良3月中旬天气 新奥尔良10月天气预报 安徽绩溪三月天气 蚌埠市7月天气 武汉2017 10月天气 蚌埠市6月份天气 蚌埠七月份天气 安徽绩溪天气预报一月份 蚌埠市7月14号天气预报 蚌埠市6月份天气 3月底蚌埠天气一般多少度 安徽绩溪天气预报一月份 蚌埠市3月份天气预报 蚌埠市7月14号天气预报 绩溪上周天气预报 罗利冬季天气温度 3月份绩溪天气 四川成都青白江区天气 武汉2017 10月天气 辽宁龙王庙天气预报 蚌埠市7月14号天气预报 昆明牟定天气预报 2016年绩溪县天气 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 异界屠 丧尸海豹突击队队长 龙跃于渊:崛起篇 魂潭 星宇辰主 万利游戏官网 欧博游戏官网 皇冠登3出租 万利游戏官网 快连下载 新奥尔良10月天气预报 辽宁龙王庙天气预报 蚌埠市3月份天气情况 武汉天气2017年10月份 安徽蚌埠7月5号天气 蚌埠七月份天气 安徽绩溪三月天气 新奥尔良10月天气预报 安徽绩溪天气前一周的天气 绩溪天气5月1天气预报 蚌埠天气7月份天气统计 绩溪县3月份天气 2016年绩溪县天气 武汉市2016年10月天气预报 2016年绩溪县天气 安徽绩溪三月天气 3月底蚌埠天气一般多少度 2016年绩溪县天气 蚌埠天气7月份天气统计 3月底蚌埠天气一般多少度 武汉天气2017年10月份 安徽绩溪天气预报一月份 武汉天气2017年10月份 3月份绩溪天气 新奥尔良3月中旬天气 武汉2017 10月天气 绩溪上周天气预报 武汉市2016年10月天气预报 安徽绩溪天气15天天气预报15天查询 新奥尔良10月天气预报