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
遵义12月份天气情况7月罗兹天气遵义7月1日天气遵义7月1天气遵义本周六天气遵义12月份天气情况洪洞七日天气遵义7月1日天气山西洪洞2016天气预报新疆巴音镇天气预报一周开州区本周双休日的天气怎样遵义12月份天气情况2016山西灵石天气预报东营十一天气遵义7月1日天气新疆巴音镇天气预报一周临汾市洪洞县历史天气预报阿坝州九寨沟天气阿坝州九寨沟天气珠海天气暴雨山西省的王家大院天气预报阿坝州九寨沟天气山西洪洞2016天气预报临夏天气预报反查遵义本周六天气玉溪天气卫星云图遵义7月1天气临夏回族自治州天气预报大气压罗兹天气预报15天查询2016山西灵石天气预报尽管不想承认……但这个世界已经如你所见……腐坏不堪。在适者生存的丛林法则里,墟界的人类单纯如蛆虫一般,在一切彻底崩坏之前,贪婪地吸食着最后一丝养分,于苦难的滋养之下,妖魔肆虐。有的人认同了这种不幸,并甘之如饴,玩弄着卑微者的生命。有的人开始醒悟,在这种看不到未来的境况中寻求解脱。他们想要逃离现世的苍白,远离这些令人窒息和疯狂的欲望,前往一个没有痛苦的理想世界……“我对这一切并没有太多的想法,深处这样肮脏的地方让我的性命平白遭受污染,我只想和我的伙伴们一起……活下去,然后找到出路。据说,在我的眼中有一方净土,其名为——归墟。”梦是一定要做的,万一是真的呢!天道俯视众生,凝聚世间万法打造九重天阙,与之共鸣者可获天赐命魂,踏上修行登天之路。 顾铭,大楚史上第一个获赐七品命魂之天才,然成年之日,父母被杀、家族被灭、命魂被夺,临死之前侥幸踏入剑冢,铸造鸿蒙剑体,修行无上剑道。两年之后,顾铭离开剑冢重返世间,踏上剑道至尊之路,一剑可斩仇敌、可破九天、可镇诸天万域。怎样才能诠释人生?是用坎坷、迷茫、彷徨的经历来诉说吗?不,或许有一种新的希望让我们可以寄托于明天。在未来世界,人类启动了基因革命,目的是让人类获得更加更加优越的生存环境 可是似乎事与愿违,在历史的长河中,这场革命终将被记录下来 而方舟似乎不是人类的方舟 灯塔不是人类的方舟的灯塔了 我们将随着时间,进入历史的长河一个清脆的响指过后,托尼·斯塔克眼前一白,什么也看不见。 ‘难道我就这么死了吗’斯塔克闭上了双眼。 ‘不好意思你还不能死.......’一道声音传来。 ‘是谁!’斯塔克见有来人大喊了一声,神经也处于紧张的状态。 ‘我是漫威宇宙的观察者,托尼·斯塔克,你是受到永恒族知识诅咒的人,你不能这么轻易的陨落。’空灵的声音传来,但只闻其声不见其人。 ‘那我该何去何从?’ ‘你将重生于C34平行宇宙中一个叫陈天身上,从头开始这一切。超级英雄还是花花公子,都由你自己选择.......’ 莫非应和图灿分离后换上了“双重人格”,三年后图灿回来第一件事就是找他,没想到在小姨的精神病院找到。同时她也没想到,她的男友居然是她的同类,她好不容易(意外)治好了莫非,却发现莫非居然不是人,但这并不妨碍他们在一起,莫非:“把我弄成这个样子,可要好好负责。”图灿一边流着口水一边说:“好好好。”一把钥匙打开了异世的大门, 【位格】的会议拉开了最终纪元的终焉。 终局到来前,星神,主宰,旧王,时局, 六个纪元的恩怨纠葛,阴谋算计,终将迎来终结。不写吧,写简介感觉像透剧 这是一个名为源气大陆的超级大陆;人们经参悟了源气的修炼方法,以修炼源气为主。产生了一些等级分别为凝气境,化源境,源丹境,源灵境,地化境,天象境,源皇境,尊者境,圣者境,至尊境,圣至尊,仙至尊,一个境界又分为九重天。在这里强者为尊,实力就是话语权。
我是李承乾 蛮荒第一狂徒 剑道传承 后宫成璧传 属于我的无尽冒险 师叔亿点强,师侄们全是气运之子! 妖孽王二狗 神话领主:万倍返还系统 法武封圣 我真的只想苟着 相亲修炼手册 赵国和燕国的对决 星辰夜雨 血之魅影之天下之盟 直播:北凉说书,周姐打赏 全球灾变:我的武功自动修炼 情脉道 普普通通的灵气复苏时代 看守所笔记 惊悚游戏小说 波兰罗兹天气趋势 缅甸30天天气 临汾市洪洞县历史天气预报 阿坝州九寨沟天气 波兰罗兹天气趋势 玉溪天气云图 新疆和静天气预报10月天气预报 新疆塔城老风口天气预报 玉溪天气卫星云图 2016山西灵石天气预报 山西洪洞2016天气预报 山西洪洞2016天气预报 临夏天气预报反查 新疆巴音镇天气预报一周 遵义11月份天气预报15天 遵义本周六天气 新疆和静天气预报10月天气预报 玉溪天气卫星云图 山西省的王家大院天气预报 遵义12月份天气情况 缅甸30天天气 遵义7月1日天气 7月罗兹天气 东营十一天气 新疆塔城老风口天气预报 临夏天气预报反查 玉溪天气卫星云图 7月罗兹天气 山西省的王家大院天气预报 玉溪天气卫星云图 遵义本周六天气 缅甸30天天气 遵义7月1天气 遵义12月份天气情况 临夏天气预报反查 遵义本周六天气 遵义7月1日天气如何 新疆和静天气预报10月天气预报 临夏天气预报反查 遵义7月1日天气如何 遵义本周六天气 中国天气网新疆巴音布鲁克 珠海天气暴雨 灵石山天气 东营十一天气 缅甸30天天气 山西洪洞2016天气预报 遵义7月1天气 罗兹天气预报15天查询 洪洞七日天气 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 爷爷重生之少年大贾 一品布衣 剑自雪中来 我为墨麒麟之子 神秘深渊 快连下载 亚星管理平台 亚星游戏官网 快连下载 百家乐官网 灵石山天气 缅甸30天天气 玉溪天气云图 玉溪天气云图 中国天气网新疆巴音布鲁克 中国天气网新疆巴音布鲁克 开州区本周双休日的天气怎样 新疆和静天气预报10月天气预报 福清灵石山天气预报 玉溪天气卫星云图 珠海天气暴雨 新疆巴音镇天气预报一周 洪洞七日天气 临夏天气预报反查 中国天气网新疆巴音布鲁克 遵义7月1日天气 缅甸30天天气 开州区本周双休日的天气怎样 7月罗兹天气 7月罗兹天气 缅甸30天天气 新疆巴音镇天气预报一周 遵义本周六天气 东营十一天气 新疆塔城老风口天气预报 2016山西灵石天气预报 灵石山天气 珠海天气暴雨 遵义本周六天气 玉溪天气卫星云图