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
厦门 探索酒店 电话维也纳广州机场店 电话厦门 探索酒店 电话广安龙摄影电话济南瑞蚨祥电话蜀味源电话葫芦岛华莱士电话临沂苏宁广场店电话扬州叫出租电话是多少钱建平中学大唐校区 门房间电话关林KTV哪里要两名服务员带电话厦门 探索酒店 电话深圳湾边检电话西塘古镇西塘派出所电话临沂苏宁广场店电话建平中学大唐校区 门房间电话奉化电话号码开头几位中领电话app中领电话app同济迎宾馆中餐厅订餐电话南宁到青岛的汽车时刻表查询电话中领电话app扬州叫出租电话是多少钱承德高速电话济南瑞蚨祥电话九江沙头外卖电话广安龙摄影电话承德高速电话同济迎宾馆中餐厅订餐电话深圳湾边检电话跟着爷爷生活在青石巷的叶明,每天都坐在门口看着爷爷接收一批又一批的客人,但是当他问起他们是谁的时候,爷爷总是笑一笑便不再多说什么。叶明也不再问什么只是专心雕刻自己手中的木头,这样的日子没坚持多久,周围开始发生一些无由的命案,起初叶明只是觉得警察多了些便不以为然,直到后来他发现自己的作品总是莫名其妙的失踪?莫非是自己长腿跑了?本故事纯属虚构新人一个,求关注,星空中有一五行树和敌人打散成金、木、水、火、土4颗种子,土为本要守护自身,另外种子不知去向,难道这星空真的是牢笼,为什么这星空没有边界... 魔法与召唤为一体的他如何回归本体,与兄弟一起打败敌人 重生在架空的大汉,刘贺一觉醒来,成了大汉的皇帝,原以为是穿越者的福利,殊不知…… 与历史上的汉废帝一样,刘贺将面对一千一百二十七条罪状,黯然离场! 环视群臣,刘贺表示心好累。 左相梁冀,右相蔡京,帝师司马懿,太师董卓,吏部尚书严嵩,刑部尚书来俊臣…… 武将有:大将军何进,义子其一安禄山,另一吕布,还有朱棣,孙权,鳌拜,以及四方将军赵括、马谡、邢道荣、李广利。 以及分封各处的异姓王:吴三桂、孔友德、韩信等…… 后宫阵容更是豪华:东宫太后赵姬,西宫太后吕雉,皇后芈月,贵妃杨玉环,昭仪苏妲己,才人武媚…… 以及历史上祸国乱政必不可少的太监团队:东厂曹正淳,西厂雨化田,中车府令赵高,十常侍张让等…… 更兼外敌如大元、大满等虎视眈眈。 境内诸如黄巾军、梁山等反贼势力丛生。 天下会、天门等武林势力与护龙山庄朱无视等对峙…… 地狱开局,刘贺有心杀敌,无力回天! 幸好,天命加身,得系统辅助,刘贺将借此,步步为营,成就千古暴君! 一个少年闯入云海之中,在云海闯荡出一个云海传说......无数年前,三界强者们为阻止域外来敌,纷纷踏上神魔轮回路,却遭人算计,主角在最后时刻施展神魔转体大法以天地真灵之躯转世重修。回归后却发现和他一起踏上神魔轮回路的强者们的家族和宗门皆已没落,主角无奈道,罢了,曾经的辉煌本座带你们重走一遍。这一世主角不在仁慈,战天庭,踏佛国,闯九幽。既然不去守护三界,那你们就别占着这三界的气运了。年代+宠妻+渣男悔过+暴富+奶爸+单女主 “周泽,你有遗憾吗?” “有” 美丽妻子死在他面前的场景,无数次出现在周泽梦中。 每次,他都仿佛被千刀万剐一样,纵是如此,也无法偿还他曾经犯下的罪。 带着巨大的痛苦和内疚,重生93年悲剧还未发生的那天。看着妻子的倩影,周泽笑的泪流满面。父母被辱,债主上门,女友背弃!俗话说的好,福不双至祸不单行,乡村小子王小飞本殷实的家庭,突发巨变,座座大山压在背上,难以喘息。 可不曾想,王小飞凭借家传之宝偶得透视之眼,从此他过上逍遥自在,人人向往的滋润生活。 可让他苦恼的是,遇到美女告白该何去何从?   玄阳穿越洪荒大地,拜师通天教主后,觉醒剑尊系统。   从此,玄阳走上了日复一日的拔剑之途。   于他而言,只要拔剑,就变强!   拔剑十万次,一剑断天河。   拔剑百万次,一剑可屠圣。   拔剑千万次,一剑平天地。   拔剑亿万次......   玄阳:“我有一剑,可平天地,逆阴阳,敢问天地众仙,谁可接我一剑!”   自此,玄阳剑圣之言,广布洪荒。少年,赵乐,自小生世显赫,奈何北宋风雨飘摇,危在旦夕!赵乐将何去何从?
破月之剑 掠夺诸天万界的生存之旅 逍遥仙医人间道 废墟之上1 黑白城之六城废墟 亘古唯一剑 预世录 末日道士行 棺来 修仙犯法么 为新神的诞生献上荆棘王冠 某人你好 神落前川 你不能死 老婆,我真是一个凡人! 论画饼,我是专业的 兆古一帝 南楚门客 我携三千诗书修圣人 江湖有你才有传奇 伊比利亚航空 中国电话 枣庄东站 电话 奉化电话号码开头几位 济南瑞蚨祥电话 伊比利亚航空 中国电话 长沙至益阻小车电话.com 珠海夏湾粤华路湛宏餐饮电话 广州友邻一路2号电话 九江沙头外卖电话 深圳湾边检电话 扬州叫出租电话是多少钱 织里味道江湖菜电话 武汉沈家湾客运段咨询电话 枣庄东站 电话 蜀味源电话 济南瑞蚨祥电话 珠海夏湾粤华路湛宏餐饮电话 九江沙头外卖电话 南宁到青岛的汽车时刻表查询电话 厦门 探索酒店 电话 枣庄东站 电话 临沂苏宁广场店电话 维也纳广州机场店 电话 西塘古镇西塘派出所电话 建平中学大唐校区 门房间电话 武汉沈家湾客运段咨询电话 九江沙头外卖电话 维也纳广州机场店 电话 南宁到青岛的汽车时刻表查询电话 九江沙头外卖电话 济南瑞蚨祥电话 枣庄东站 电话 平阳县职业中等专业学校电话 蜀味源电话 承德高速电话 济南瑞蚨祥电话 平阳县职业中等专业学校电话 奉化电话号码开头几位 武汉沈家湾客运段咨询电话 临沂苏宁广场店电话 广安龙摄影电话 株洲的士公司电话 华夏计算机职业技术学院电话 织里味道江湖菜电话 西塘古镇西塘派出所电话 枣庄东站 电话 织里味道江湖菜电话 广安龙摄影电话 武汉沈家湾客运段咨询电话 葫芦岛华莱士电话 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 看江 612事件 梦宰沧溟 全民领主:我能召唤历史人物 锁穹 亚星官网 万利官网 欧博游戏官网 亚星官网 葡京官网 济南瑞蚨祥电话 仙人度饭馆 电话 广州友邻一路2号电话 南宁到青岛的汽车时刻表查询电话 织里味道江湖菜电话 西塘古镇西塘派出所电话 株洲的士公司电话 九江沙头外卖电话 枣庄东站 电话 南宁到青岛的汽车时刻表查询电话 中领电话app 济南瑞蚨祥电话 南宁到青岛的汽车时刻表查询电话 深圳湾边检电话 关林KTV哪里要两名服务员带电话 枣庄东站 电话 广安龙摄影电话 中领电话app 建平中学大唐校区 门房间电话 株洲的士公司电话 珠海夏湾粤华路湛宏餐饮电话 同济迎宾馆中餐厅订餐电话 广安龙摄影电话 伊比利亚航空 中国电话 蜀味源电话 移动接国外电话 济南瑞蚨祥电话 武汉沈家湾客运段咨询电话 深圳湾边检电话 株洲的士公司电话