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
家庭教师 云雀头像闺蜜5头像霸气微信头像女生抽烟情侣微恐怖动漫头像图片大全集懂你字头像家庭教师 云雀头像可爱动漫小头像女生唯美霸气微信头像女生抽烟我要个性网女生动漫头像女生头像图片两人兄弟头像带字头像两张背影日本鬼子头像动态家庭教师 云雀头像白衬衫女生头像侧脸日本鬼子头像动态霸气微信头像女生抽烟两人兄弟头像带字头像两张背影最新女生头像周排行懂你字头像懂你字头像日出风景·头像动漫情头像情侣一对两张全身头像邓紫棋弟兄头像6人非主流唯美黑白头像女生背影2017年最火的男生头像好看的qq女生头像潮流情侣微恐怖动漫头像图片大全集汪星人头像图片大全可爱日出风景·头像女生多人结拜头像卡通一朝穿越,江晓觉醒最强宗门系统,召唤异界各路神仙玩家,带领洪门崛起。 天玄大陆从此变了天。 “禀告宗主,洪门弟子越战越勇、悍不畏死,我们的弟子根本阻挡不住……” “洪门弟子修建的“黑色长城”我们根本打不动,连山门都打进不去……” “灵药山洪门弟子把我们的灵药洗劫一空,连根灵草都没剩下,受伤的弟子已经没药疗伤……” 无上仙宗宗主:“洪门弟子实在太凶猛了,传令下去,所有弟子撤退!” “禀告宗主,洪门弟子已经把无上仙宗打下来了,我们已经无处可退……” “什么?难不成洪门上下,都是一群神仙?” 我们就是一群游戏玩家。操纵一个角色在生活里打打杀杀。谁说那只是游戏呢?每一个角色后面,都有一个认真的灵魂。喜怒哀乐尝遍,却不改初衷。林辰用短短三百年时间,成为仙界最年轻的仙帝,却遭三大老牌仙帝联手围攻,同归于尽。 未曾想重生回到少年时的蓝星,这一世他将不再留有遗憾,有怨报怨,有仇报仇! 修仙之路也将更加势不可挡!天命之年也能穿越?早就被生活磨平棱角的主角重回40年前,乘着改革开放的大船,扬帆起航。 这是三十年后的地摊货?不不不,这在现在是潮流。 你是混社会的?打打杀杀没前途,跟我一起做公益吧。 你会管理?那这家公司交给你打理。 咱们老板去哪里了?听说好像在哪个五线城市开小超市呢。 咱们老板又去哪里了?听说好像在非洲某个国家打内战呢。 咱们老板又又去哪里了?听说好像在南海某个小岛钓鱼呢。 咱们老板又又又去哪里了? …… 没有大的志向,却创下了偌大的家业,面对着巨大的财富,却不懂得如何去享受,依然只是抽着十几块钱的烟,喝着自家酿的酒。千年之前莫残雪,千年之后齐唤心!身具文武双魄,行走世间维护苍生,风水阴阳,奇门五行,降妖王,收厉鬼,斗僵尸,战魔王,最终成为一代宗师。本书描写了葛二两跟师父须菩提学了三十六般变化和高超的武功,携孙悟空、猪八戒、关羽关云长穿越到亘古洪荒的年代,帮助蚩尤和黄帝争夺天下的故事。都说时势造英雄,都说站在风口浪尖上的哪怕就是猪也可以起飞。 而如今,异界的幻想神格砸落王羽身上。 他将何去何从,平淡一生,荒骨枯坟还是俯瞰万界,遥指乾坤?一位新作者,写到不好请见谅。意外穿越大秦,成为八公子嬴子夜,觉醒神级阅读系统,只要读书就变强!只要读书就能获得无限奖励,只要读书便可入圣! 为此,嬴子夜终日闭关读书,兢兢业业,不招灾,不惹祸。 终有一日! 始皇重危,意欲东巡求长生。 墨家蠢蠢欲动。 六国余孽准备造反。 赵高意欲篡改遗诏。 …… 嬴子夜知道,这时候不能继续藏了!再藏大秦不复、自己也将被胡亥杀死! “扮猪吃虎十余年,今日本公子不藏了!” “今日,本公子以读书入圣!一剑斩天!” “传令,三千大雪龙骑军出动!” “传令,铁浮屠出动!” “……” 刀光剑影快意恩仇,江湖二字,奇妙热烈,总令人心潮涌动。少年意气弹铗高歌,倾盖如故的兄弟,风流婉约的美人,谁说鱼与熊掌不能兼得?
武魂歌之江南风 滨海三侠穿越神奇诡异之行 我真不是天道啊 阳归故里 江湖不归人 九子神兵 仙人诀?! 狙杀成塔 我被拐卖的那些年 绝美总裁的贴身狂医 程序猿异界论 命里有个妹 世末奇迹 全球惊悚:我再不死,就真无敌了 很想给你一生幸福 重返西游 我的世界灵力首部灵力大陆 长的帅的确运气特别好 浪起江湖 百岁福 欧美头像气质男生头像 两人兄弟头像带字头像两张背影 最新女生头像周排行 懂你字头像 欧美头像气质男生头像 头像爱笑女孩图片 闺蜜头像双人动漫 闺蜜头像动漫分开不带字图片带字 好看的qq女生头像潮流 白衬衫女生头像侧脸 弟兄头像6人 弟兄头像6人 非主流唯美黑白头像女生背影 两人兄弟头像带字头像两张背影 网络少女心头像动漫 2017年最火的男生头像 情侣头像两个人黑白 好看的qq女生头像潮流 闺蜜5头像 家庭教师 云雀头像 太空气球头像 霸气微信头像女生抽烟 闺蜜5头像 头像邓紫棋 闺蜜头像动漫分开不带字图片带字 非主流唯美黑白头像女生背影 好看的qq女生头像潮流 闺蜜5头像 动漫情头像情侣一对两张全身 好看的qq女生头像潮流 懂你字头像 太空气球头像 情侣微恐怖动漫头像图片大全集 家庭教师 云雀头像 非主流唯美黑白头像女生背影 2017年最火的男生头像 穿红色衣服的女生头像动漫 闺蜜头像双人动漫 非主流唯美黑白头像女生背影 穿红色衣服的女生头像动漫 2017年最火的男生头像 头像女生六个人的 日出风景·头像 情侣头像两个人黑白 日本鬼子头像动态 太空气球头像 弟兄头像6人 2017年最火的男生头像 qq头像卡漫情侣头像图片 可爱动漫小头像女生唯美 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 辉光之界 网游之绝世剑尊1 兄弟,我们走 阴差子兮 这个剑神有点浪 快连下载 亚星游戏官网 亚星官网 快连下载 亚星管理平台 欧美头像气质男生头像 懂你字头像 可爱动漫小头像女生唯美 情侣头像两个人黑白 最新女生头像周排行 太空气球头像 非主流唯美黑白头像女生背影 家庭教师 云雀头像 两人兄弟头像带字头像两张背影 闺蜜头像动漫分开不带字图片带字 太空气球头像 欧美头像气质男生头像 闺蜜头像动漫分开不带字图片带字 女生多人结拜头像卡通 白衬衫女生头像侧脸 懂你字头像 情侣微恐怖动漫头像图片大全集 最新女生头像周排行 头像邓紫棋 两人兄弟头像带字头像两张背影 日本鬼子头像动态 家庭教师 云雀头像 弟兄头像6人 欧美头像气质男生头像 霸气微信头像女生抽烟 穿红色衣服的女生头像动漫 家庭教师 云雀头像 可爱动漫小头像女生唯美 穿红色衣服的女生头像动漫 懂你字头像