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
湖北随州至东莞汽车湖州至准安汽车朝阳汽车站图白城汽车票代购网点达州到西宁汽车站时刻表湖北随州至东莞汽车广州到观珠汽车朝阳汽车站图濮阳济南汽车时间大姥山汽车站贵阳到福建汽车票朝阳汽车站图东营泰安的汽车时刻表贵阳到福建汽车票郑州至沛县汽车票价大姥山汽车站杭州到平邑的汽车票麻章到罗定的汽车站时刻表麻章到罗定的汽车站时刻表南宁到金秀汽车林州汽车北站到漯河麻章到罗定的汽车站时刻表濮阳济南汽车时间淄博到皱平汽车达州到西宁汽车站时刻表上海浦东到宣城的汽车时间表观澜汽车站到合浦淄博到皱平汽车南宁到金秀汽车东营泰安的汽车时刻表“在这个充满烟火的世界,我们又为谁而燃烧!” 主角南风的国家与另一个国家发生战争,而南风却身陷敌国。白清水作为南风的敌国,同时也是朋友的身份下与南风在这样的战争背景下逐渐解开迷题,然后迈向世界本书为原创长篇小说,分为两部。分别是上篇《亿兆富翁的百日蜕变》,下篇《亿兆富翁的二潜舰队》。 描写的是男主角“乌鸟炎”由都市普通人意外成为《亿兆富豪》栏目的幸运观众,从而开启了一段新的人生。穿越成为镇南王府的世子,本来想安安心心当一个纨绔,上街打算强抢民女,却没想到一个不小心竟然抢走了微服出宫的当朝公主!更没想到的是,皇帝不但没有怪罪,反而将公主赐婚给他!不是吧,我真的不想当驸马爷! 黎伶曾见过死而复生的人,她也希望成为那样的人,唯有超越死亡的束缚,才能拥抱无尽的幸福。 不过啊,不凋花仅是一场梦,而一场梦,终究是徒生花。世纪之末,资源匮乏,经济崩盘,各国剑拔弩张,即将展开世界大战,变故突如其来。 世界各地突然出现各种各样大小不一的漩涡之门,经过部分胆大之人的探索,发现它们通往不同的异世界,与此同时,人群中开始出现许多觉醒各种能力的人类,他们有的会喷火,有的会飞行,还有的会眼放激光。 拥有能够获得神奇物品和能力的他们成为了探索异世界的主力,世界的格局也因此发生变化在这个世界,大部分人的身上都存在着名将,他们为了不灭和永生……梁凡穿越到被中洲国国丈废弃后扔到边疆的皇子身上,正赶上国丈买通马匪前来杀自己,危急时刻梁凡获得异宝地精之力,反杀马匪。 梁凡投入军中,一步步崛起,待回京欲要表明身份,夺回大权时,却生异变,身受重伤,被烈阳、烈一一父女二人救回极北狼族疗伤。 极北冰寒之地潜伏的狼魂,慢慢苏醒··· 莽莽戈壁滩上狼烟四起的凶兽战场··· 危机四伏的丛林,神秘的古巫族,奇闻中的东海修仙族··· 我本良善,奈何凶兽环伺左右! 准备好,凡爷来了! 这本书会更新的很慢很慢,就好像蜗牛爬山一样。孤儿高中生刘白高考之后,意外穿越到一个异世界,被一个佣兵收养,孩童时期就上战场,挣扎在生死边缘,领略了异世界的残酷和尔虞我诈之后,一点一点的历练,一步一步的成长,被时代裹挟着跌跌撞撞的生活,之后认识了一个与他年龄相仿,但是极具人格魅力和野心的佣兵团长齐尽墨,二人一见如故,刘白答应帮他实现自己的梦想。就在齐尽墨的梦想即将实现之时,变故发生了....仙灵降世,灵气复苏。 妖尊悟空惨被菩提老祖疯狂追杀,重创之际,利用仅剩神力,封锁火星之石隧道,化作一粒记忆碎片陨落…… 百年之后,飞落水球,成为了水球人类的大脑思维结晶,之前历史记录,书籍神话人物,都是该神的记忆,最后徒弟秦记展开了亿年的复仇计划……
末世,全能战神 修真破天记 齐天大圣:轮回人间三千年 销魂入梦 绝命兵王 五界战乱:闯荡人间 中二少年进化论 欢喜谐谑曲 死亡推理之追狱人 炼妖手册 封神之铁血艳影 踏上这条通往未知的道路! 天翼的非正常日常 都市从欢乐颂开始签到 神祇:独步仙魔 我在登基典礼上被截胡了? 穿越之大侠宋青书 穿越,人类最强手拿把掐 基因吞噬纪元 空白黑夜之赵冬生 湛江到合浦汽车时间表 婺源到嘉兴汽车时刻表 杭州到平邑的汽车票 达州到西宁汽车站时刻表 湛江到合浦汽车时间表 杨州到滁州汽车时刻表 杭州到平邑的汽车票 深圳到桐乡汽车站时刻表 上海浦东到宣城的汽车时间表 福永到黄埔汽车时刻表 安徽阜阳到徐州汽车票 安徽阜阳到徐州汽车票 郑州客运南站汽车票 婺源到嘉兴汽车时刻表 湖北随州至东莞汽车 达州到西宁汽车站时刻表 阳春汽车客运站到长安 上海浦东到宣城的汽车时间表 景洪有汽车站时刻表 朝阳汽车站图 婺源到嘉兴汽车时刻表 郑州至沛县汽车票价 湖州至准安汽车 贵阳到福建汽车票 大姥山汽车站 郑州客运南站汽车票 上海浦东到宣城的汽车时间表 湖州至准安汽车 景洪有汽车站时刻表 上海浦东到宣城的汽车时间表 达州到西宁汽车站时刻表 牡丹江到大连汽车时刻表查询 白城汽车票代购网点 湖北随州至东莞汽车 淄博到皱平汽车 达州到西宁汽车站时刻表 白城汽车票代购网点 杭州到平邑的汽车票 郑州客运南站汽车票 郑州至沛县汽车票价 观澜汽车站到合浦 福永到黄埔汽车时刻表 新晃到玉屏汽车票价 阳春汽车客运站到长安 贵阳到福建汽车票 婺源到嘉兴汽车时刻表 安徽阜阳到徐州汽车票 观澜汽车站到合浦 郑州客运南站汽车票 广州到观珠汽车 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 大秦第一隐士 重生S8,操作像小说男主 谢邀,人在洪荒,拒绝妖皇 温柔总裁霸道妻苏夏曲皓琛 在魔法的世界当武者 快连下载 亚星管理平台 亚星游戏官网 快连下载 亚星管理平台 婺源到嘉兴汽车时刻表 安徽阜阳到徐州汽车票 深圳到桐乡汽车站时刻表 大姥山汽车站 湛江到合浦汽车时间表 深圳到桐乡汽车站时刻表 浙江新浦汽车站时刻表 湖州至准安汽车 广州到观珠汽车 观澜汽车站到合浦 阳春汽车客运站到长安 观澜汽车站到合浦 南宁到金秀汽车 达州到西宁汽车站时刻表 濮阳济南汽车时间 牡丹江到大连汽车时刻表查询 林州汽车北站到漯河 南宁到金秀汽车 湖州至准安汽车 林州汽车北站到漯河 白城汽车票代购网点 景洪有汽车站时刻表 上海浦东到宣城的汽车时间表 郑州至沛县汽车票价 杨州到滁州汽车时刻表 浙江新浦汽车站时刻表 郑州客运南站汽车票 浙江新浦汽车站时刻表 牡丹江到大连汽车时刻表查询 广州到观珠汽车