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
己已年1989邮票国家重点保护野生动物邮票己已年1989邮票一轮生肖邮票发行量2014年马年邮票1985乙丑年 邮票圣马力诺邮票5枚一套飞机图样庚午年生肖马邮票九星汇聚邮票价格第一轮猪邮票价格第二轮十二生肖邮票银砖大全套己已年1989邮票步辇图 邮票第三轮生肖邮票四方连庚午年生肖马邮票第一轮猪邮票价格建军50周年邮票2007猪邮票2007猪邮票2010年香港邮票发行计划中国价值最高的邮票2007猪邮票九星汇聚邮票价格1996-2邮票2014年马年邮票2005年纪特邮票《乙酉年》一轮生肖邮票发行量1996-2邮票2010年香港邮票发行计划步辇图 邮票他,为爱入狱五年,出来竟发现未婚妻跟别人订婚了,原来他一直在错付!得知真爱父母双亡,瞎了眼睛, 成了家族的弃子!陈九临一怒之下,施针救人扭转乾坤! 摊牌了,老子就是南境之王,这一次我要让你做最幸福的女人! (纯架空文) 邮轮失事,流落荒岛,危机四伏,当别人还在因为下暴雨无处躲寻的时候,秦渊已经在庇护所安稳的度过。 当别人饿肚子的时候,秦渊已经吃上了烤肉,海鲜。 失事船长:“我们要齐心协力,走出困境!” 秦渊:“不好意思,道不同不相为谋!” 有钱人:“兄弟,我花钱买你的肉,就让我吃一点!” 秦渊:“钱?在这岛上,就是废纸!” 当红女网红:“能不能分我们一口吃的?” 秦渊:“少跟我装可怜,这里是荒岛!”我叫楚枫。 我穿越了,竟然还成为了一只卡比兽! 正准备躺平,结果觉醒了大卡比兽系统 肚子饿了天降能量方块,嗑着磕着突破了 永久失眠换来了自律就能无限变强。 本来我以为自律就是坚持锻炼健身, 没想到触摸极限后,系统居然要我练武,还要横练! 越练越大只 大只,就是强。 简介:本该人生平平无为的主角,从一个性格柔弱到脱变成刚毅的成长故事,后来主角从这跌宕起伏的生涯中成就无上荣耀。【系统+无女主+穿越】(萌新作者,文笔不好勿喷) 刘铭死了,但又没完全死。准确的说,他,跟随潮流一起穿越了。穿到了一个名为哈利波特的魔法世界,而他生前就是一个哈迷。 但这个哈利波特世界跟jk罗琳写的哈利波特有所出入。比如,这个世界并没有黑魔王,詹姆和莉莉也好好的活着,哈利·波特还多了个双胞胎哥哥。 而刘铭穿成了哈利的双胞胎哥哥伊雷·波特,当然作为穿越众中的一人,金手指也是必不可少。所以当他穿越到这个世界一年后。他得到了一个名叫霍格沃茨最强抽卡的系统。 【恭喜抽到传说卡:黑魔法精通】 【恭喜抽到传说卡:我蓝超多】 【恭喜抽到技能点】 【恭喜抽到传说卡:变异蜷翼魔】 …… 伊雷无奈的摊了摊手“没办法,太欧了”一位拥有着超能力的废材,会发生什么样的故事呢?杀猪匠不杀五指之猪,守村人不守有庙之村,风水师不点血龙宝地,接生婆的手必须用公鸡血清洗,世间360行,行行有行规黄墚一梦终须醒,无根无极本归尘。 金龙飞天归何处,不如凡间做真人。 最终章将梦醒作为结局,人生如戏,南柯一梦。【穿越+无敌+爽文+东方玄幻+宗门势力+种田流】 穿越玄幻世界,君九天成为玄天派的掌门! 在门派即将解散之际,觉醒了最强门派系统。 只要收弟子就变强! 送弟子机缘全都暴击返还! 于是,君九天勤勤恳恳,日夜为宗门发展而努力。 终有一日,君九天下山了。 才发现自己的弟子,一个个都成了修仙界大佬! 而他自己早已无敌于世!萧易穿越到洪荒,成了一个刚要拜入截教的初代人族。 激活了极品负能量系统,收集别人的负面情绪,就能够变强! 从此,洪荒多了一个整日作死的截教大弟子。 “师傅!大师兄又闯祸了!他把剑冢的剑都融了!说要做大宝剑!” “师傅!大师兄炼器炸了一座山,把藏书阁埋了!!” “通天!你徒弟又作死!把我的坐骑四不像吃了!!!” “通天!你徒弟把我侍女掳走了!!” “.....” 通天整日惶恐,生怕自己大弟子闯祸... 直到这一日,鸿钧出关,宣布封神大劫起。 通天拒绝截教封神,以一敌五圣,截教面临大劫! 往日只会作死的截教大弟子:“我不装了,我已成圣!” 
渡劫飞升 关于冒险六章的那些事 刷怪录 遇见你满是心酸 沧御 万纹之秘 至道眼 圣元魔尊 大人饶命 乱世殇歌行 第一次遇见神待少女 我的小师弟可太稳健了 我的新纪元 大道之无恨 刀光里的掌印 从鬼灭开始砍爆一切 不凋花之梦 帝国模拟器:开局召唤大雪龙骑 异世之仙路奇缘 青龙大战黑龙潭第二部 中国与世博会邮票 12生肖邮票 建军50周年邮票 2007猪邮票 中国与世博会邮票 西厢记邮票值多少钱 邮票价格林伯渠 中国生肖邮票 2005年纪特邮票《乙酉年》 步辇图 邮票 九星汇聚邮票价格 梅兰芳邮票价格 新中国邮票发展史 第一轮猪邮票价格 1985乙丑年 邮票 2014年马年邮票 邮票价格林伯渠 2005年纪特邮票《乙酉年》 中国价值最高的邮票 己已年1989邮票 12生肖邮票 庚午年生肖马邮票 国家重点保护野生动物邮票 第三轮生肖邮票四方连 第一轮猪邮票价格 新中国邮票发展史 2005年纪特邮票《乙酉年》 国家重点保护野生动物邮票 中国价值最高的邮票 2005年纪特邮票《乙酉年》 2014年马年邮票 12生肖邮票 第三轮生肖邮票价格查询 己已年1989邮票 1996-2邮票 2014年马年邮票 第三轮生肖邮票价格查询 建军50周年邮票 新中国邮票发展史 庚午年生肖马邮票 一轮生肖邮票发行量 三轮十二生肖整版邮票 毛主席邮票价格 梅兰芳邮票价格 第三轮生肖邮票四方连 12生肖邮票 梅兰芳邮票价格 一轮生肖邮票发行量 2010年香港邮票发行计划 圣马力诺邮票5枚一套飞机图样 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 变身修仙女战皇 我被仙门选中了 仙帝的强者儿子 我在诸天当黑商 轮回玉梅林 百度 百度 百度 百度 百度 新中国邮票发展史 中国价值最高的邮票 九星汇聚邮票价格 庚午年生肖马邮票 中国邮政邮票1998-3 中国与世博会邮票 己已年1989邮票 2005年纪特邮票《乙酉年》 步辇图 邮票 1996-2邮票 步辇图 邮票 第三轮生肖邮票四方连 太湖 邮票 2010年香港邮票发行计划 邮票价格林伯渠 毛主席邮票价格 第三轮生肖邮票四方连 己已年1989邮票 毛主席邮票价格 三轮十二生肖整版邮票 1985乙丑年 邮票 第三轮生肖邮票价格查询 中国生肖邮票 一轮生肖邮票发行量 己已年1989邮票 2007猪邮票 中国与世博会邮票 邮票价格林伯渠 2005年纪特邮票《乙酉年》 第二轮十二生肖邮票银砖大全套 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网