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
蒙古国达尔罕市天气预报辽宁喀左历史天气预报蒙古国达尔罕天气蒙古乌海天气预报阿尔山旅游天气蒙古国达尔罕市天气预报平顶山昨天气温蒙古国达尔罕天气喀左天气jilu7yue合肥 安庆交通天气预报丹麦十月下旬天气蒙古国达尔罕天气金寨汤家汇镇天气丹麦十月下旬天气蒙古国施工天气合肥 安庆交通天气预报普玛江唐天气预报10月西伯利亚天气阿尔山旅游天气蒙古国10月天气喀左天气预报30天10月西伯利亚天气喀左天气jilu7yue云南各地市天气2017年铜陵10月份天气蒙古10份天气预报2017年铜陵10月份天气云南各地市天气蒙古国10月天气金寨汤家汇镇天气春秋末期,诸侯大战,天下一片混乱。 时值封神过后五百年,世上再无修真。乱世中神、鬼、妖、仙、人各行其事。孔子曰“礼崩乐坏”! 十四岁少年子姜,崛起于秦岭,历尽诸般磨难,终成于昆仑,一举荡平神鬼妖仙之混乱,还朗朗乾坤于人世间。 自此之后,为民族立下大功劳者方能封神; 自此之后,再有为祸世间者一律转入鬼道; 自此之后,修仙有成者不得留恋人世间; …… 他,为爱入狱五年,出来竟发现未婚妻跟别人订婚了,原来他一直在错付!得知真爱父母双亡,瞎了眼睛, 成了家族的弃子!陈九临一怒之下,施针救人扭转乾坤! 摊牌了,老子就是南境之王,这一次我要让你做最幸福的女人! 本文根据民间传说以及部分地方史志创作完成,从一个一个小小的侧面,为读者展现围绕鞶镇这片北方的土地上,人们生生不息,千年来上演的一幕幕世事人伦、爱恨情仇及家国情怀。本文由一些相对独立的故事组成,虽有关联但不紧凑。首先,从一个人物说起……这里有小说,也有散文、诗歌,汇聚成一部有复杂情感的365个夜晚故事,请您慢慢欣赏。大学生党员肖来秋和同学林知白利用暑假,到东北沿着祖辈肖光乾、肖光坤走过的路线,探寻两位革命前辈投笔从戎,为实现民族独立,人民解放的伟大理想,忘我奋斗的历史足迹。进而揭示出,为了完成中国共产党的历史使命,一代又一代共产党人进行了不懈的努力。既有老一辈革命者肖光乾,肖光坤等人的浴血奋战,也有生长在红旗下的高树屯的党支部书记陆昌永的艰苦创业,还有八零后大学生党员姚续的扶贫攻坚,以及广大理论工作者对无产阶级革命理论的坚持。进而绘就一幅中国共产党人跳出“其兴也勃焉,其亡也忽焉”的历史周期律,使党的基业坚如磐石,乾坤永续的壮丽画卷。差点被夺舍的林逸.......从一名普通人,摇身一变,成为了一名天才武者。行尸走肉,人形血眼,恐怖地下室………危险重重,这次我要娶你一笔聚集万千大道,号令十方鬼神,斩断无数因果轮回,历经亿万次轮回的恐怖直播最终被终结在梦中寻找希望,入轮回窥探过去夏归凡一觉醒来发现自己成为了一宗之主,解决了宗门危机之后,修为倒退,这时脑海中出现了一部法决《噬典圣诀》,能够吞噬记录法决、武技等的载体(书籍、竹简等),并对该法决或武技的熟练度即刻达到百分百圆满之境,那么这世间,万般武技和秘法没有什么是我夏归凡无法立即熟练的。 令夏归凡头疼的是,他这宗主收了七名女徒弟,个个人间绝色,但个个都不是省油的灯...... 本小说又名《穿越成为宗主》、《我名下都是女徒弟》、《女徒弟带着我无敌》、《我带着女徒弟无双》。
九霄神殿 封妖万界 须弥戒内 异世之开局捡到一头龙 古海有云 高三回忆录 网游之星觉逆世 那年江湖那些事 武综大冒险 世界的面人旅行者 草根的金手指 系统:转生成狗也要当最强 末日樊笼 恶来传 铭道录 大明:满朝奸臣,你让我登基称帝? 短片集合 迷途与归路 破军至尊 符仙传人在都师 辽宁喀左天气预报15天 俄罗斯十月下旬天气预报 普玛江唐天气预报 阿尔山旅游天气 辽宁喀左天气预报15天 蒙古5月天气 普玛江唐天气预报 未来十天大连长海县天气预报 蒙古10份天气预报 云蒙山国家森林公园天气 全国各城市雾霾天气排行榜 全国各城市雾霾天气排行榜 蒙古额尔登特天气 俄罗斯十月下旬天气预报 蒙古国达尔罕市天气预报 阿尔山旅游天气 上海今日天气整点 蒙古10份天气预报 江西太湖天气预报 蒙古国达尔罕天气 俄罗斯十月下旬天气预报 蒙古国达尔罕天气 江西太湖天气预报 10月西伯利亚天气 合肥 安庆交通天气预报 蒙古额尔登特天气 辽宁喀左天气预报15天 辽宁喀左历史天气预报 江西太湖天气预报 蒙古10份天气预报 阿尔山旅游天气 俄罗斯十月下旬天气情况 蒙古乌海天气预报 蒙古国达尔罕市天气预报 云南各地市天气 2017年铜陵10月份天气 蒙古乌海天气预报 普玛江唐天气预报 蒙古额尔登特天气 蒙古国施工天气 2017年铜陵10月份天气 未来十天大连长海县天气预报 深圳为例三天天气预报 上海今日天气整点 丹麦十月下旬天气 俄罗斯十月下旬天气情况 全国各城市雾霾天气排行榜 2017年铜陵10月份天气 蒙古额尔登特天气 平顶山昨天天气预报查询 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 守望:光与暗的对决 随便成为什么 这一世我再扬帆 贰拾玖楼 老槐树下的故事 快连下载 亚星游戏官网 亚星官网 欧博官网 亚星管理平台 平顶山昨天气温 蒙古10份天气预报 深圳为例三天天气预报 合肥 安庆交通天气预报 普玛江唐天气预报 蒙古额尔登特天气 云蒙山国家森林公园天气 蒙古国施工天气 全国各城市雾霾天气排行榜 俄罗斯十月下旬天气预报 蒙古5月天气 蒙古5月天气 未来十天大连长海县天气预报 云蒙山国家森林公园天气 俄罗斯十月下旬天气情况 上海今日天气整点 金寨汤家汇镇天气 辽宁喀左天气预报15天 喀左天气预报30天 蒙古国达尔罕天气 平顶山昨天天气预报查询 蒙古额尔登特天气 蒙古乌海天气预报 蒙古10份天气预报 俄罗斯十月下旬天气预报 蒙古国达尔罕市天气预报 蒙古10份天气预报 全国各城市雾霾天气排行榜 云蒙山国家森林公园天气 金寨汤家汇镇天气