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
二十来天的宝宝拉肚子怎么办无创21三体宝宝多吗20个月宝宝哭呕吐六个月宝宝穿多大鞋子宝宝9个月的疫苗二十来天的宝宝拉肚子怎么办六个月大的宝宝能吃银耳吗20个月宝宝哭呕吐宝宝一个多月自己拉屎要用力宝宝趴在妈妈身上睡图20个月的宝宝小腿弯二十来天的宝宝拉肚子怎么办宝宝8个月两边脸颊潮红潮红?20个月的宝宝小腿弯20个月宝宝哭呕吐宝宝趴在妈妈身上睡图四个月宝宝五天不拉粑粑宝宝9个月的疫苗宝宝9个月的疫苗一岁四个月宝宝牙齿有白色小宝宝百天祝福语给宝宝拍嗝宝宝四肢颤抖宝宝一个多月自己拉屎要用力宝宝戒夜奶多长时间成功宝宝害眼老流泪和眼屎宝宝屁股带黑灰是怎么回事六个月宝宝穿多大鞋子宝宝几个月忌奶一岁四个月宝宝牙齿有白色二岁宝宝肠胃炎不爱吃东西  我出生在一个民风彪悍,法治混乱的山区偏远小镇——黑池镇,黑池镇在当时简直可以说是贫穷、暴力、血腥、残酷这些字的代名词。   破旧不堪的房屋和街道,苟延残喘的隐君子,无处不在的站街女和色情发廊,以及那些刀口舔血的亡命之徒,在这里我也将遇到那些和我一起出生入死,闯荡江湖,叱咤风云的弟兄们!反侵略战争中,帝国战败,人民惨遭屠戮。联盟通过傀儡政府,对帝国进行高压统治。 不甘被支配的年轻一辈踏上征途,横眉冷对那些的所谓“爱国者”的谩骂,将复国计划悄悄上演。 前行于黑暗,背负骂名与罪孽,一切只为星火燎原。侠是一种精神,一种意志,就存在于人的良知中。 一旦唤醒,则能成为无坚不摧的力量,不畏险阻,砥砺前行。 贺宏己是一名十九岁的大学生,三观正,爱国家,家境富有,但是钱财来源多是他那唯利是图的父亲收敛来的不义之财,曾被贺宏己多次匿名举报。 有一天一个女孩告诉他父亲,如果再行不义之事,报应将会降临在你的后代之身,果不其然,在贺宏己的父亲想要挖掉英烈之墓建造房产时,贺宏己便意外坠楼了,这一切贺宏己都不知道是如何发生的。 在坠楼的一瞬间,贺宏己来到了一片空白的空间内,他遇到了一个穿着绿裙子的女孩,这个女孩改变了贺宏己的一生,她给予了贺宏己特殊的能力,把他带到了武工队传奇的世界里。 妇科专精?软饭天王?盲人按摩? 笑话! 看我神针渡穴,妙手救人。 你富甲天下,权势无双,亦要在我面前低头,因为,我掌控你的生死。 这是一个从妇科专精开始的神医路。 多年后,陆沉回头,中医已经熠熠生辉。 我真是服了,第二次了,怎么又是让一个老六给刀了,这个时候给我一刀。完了完了,要嗝屁了。 闫鞅使劲捂着身上的伤口,但是他现在视线已经开始模糊。上次给我一次穿越的机会,看来这次真的要死翘翘了,如果有下辈子,我也要当一个老六,给那些人一人一刀。我叫宋小江,我有108个师姐,大师姐倾国倾城,武力滔天! 二师姐温文尔雅,琴棋书画样样精通! 三师姐医术超凡,妙手回春…… 她们一会儿说要把公司给我,一会儿让我当殿主,一会儿又让我当战神,这可如何是好? 在线求解,挺急的!高中学霸男生女生的跨界成长之路,小欢喜、小灵异、小感动最终演变一场波澜壮阔的心灵冒险。十几年前,赵辉以优异成绩进入北电影院导演专业,并且在新生期间,就连续拍摄了三部电视剧,而每一部都掀起了一股收视率狂潮, 更是带火了一大批同年级的北电影院表演系的学生..... 随后,赵辉又转战电影领域,用一部小成本的电影,再次豪取千万的票房。 因此,一时间,赵辉之名不仅响彻北电影院,更是震动了整个娱乐圈儿。 而也就在大家都认为娱乐圈要进入赵辉时代时,在一次外出的路上因救一位过路的小女孩儿,被车撞伤陷入了昏迷之中。他这一昏迷就是长达十二年之久, 而他所带火的那些同学却都已成为娱乐圈儿当红的演员,还有,当年被他救下的那个小女孩儿也长大了。 而也就是这一日,那个躺在病床上长达十二年之久的赵辉却是毫无征兆的睁开了双眼...五年后叶云天重返都市,发现当年帮他的美女被害成了瘫子,当年青梅竹马的婚约女友骂他下等人,当年埋葬父母的坟头不许祭拜! 但谁人清楚,他已再不是当年的废物,而是人间最大势力诸天的王者!
永道超然 神医王婿 重生1992 我在殡仪馆玩推理 疯了吧,我宗门的弟子都成仙了! 与神王负明 太阳系的秘密档案 模拟:开局收了女帝做丫鬟 极夜歌行 巍巍高楼起 霸王臂 回忆频频扰 黑色余火 噩梦教室 灵气复苏一千年后 莫名成神 淦!我竟然这么猛! 娱乐!我真不想成顶流! 著名的影帝演技 噬沙 宝宝屁股带黑灰是怎么回事 宝宝趴在妈妈身上睡图 四个月宝宝五天不拉粑粑 宝宝9个月的疫苗 无创21三体宝宝多吗 宝宝几个月忌奶 宝宝拉便便就像果冻 两个月宝宝睡得多吃的少 新生儿宝宝吃奶粉不喝水怎么办 宝宝8个月两边脸颊潮红潮红? 9个月宝宝爱玩没食欲 9个月宝宝爱玩没食欲 宝宝戒夜奶多长时间成功 宝宝趴在妈妈身上睡图 二十来天的宝宝拉肚子怎么办 宝宝害眼老流泪和眼屎 宝宝黄疸期间发烧怎么回事 宝宝屁股带黑灰是怎么回事 4岁宝宝智力测试表 20个月宝宝哭呕吐 20个月宝宝打人 20个月宝宝哭呕吐 4岁宝宝智力测试表 给宝宝拍嗝宝宝四肢颤抖 母乳宝宝用安抚奶嘴 胖妈妈生宝宝好生吗 宝宝屁股带黑灰是怎么回事 4岁宝宝智力测试表 小宝宝百天祝福语 宝宝屁股带黑灰是怎么回事 宝宝9个月的疫苗 20个月宝宝打人 六个月宝宝穿多大鞋子 二十来天的宝宝拉肚子怎么办 宝宝戒夜奶多长时间成功 宝宝害眼老流泪和眼屎 六个月宝宝穿多大鞋子 宝宝拉便便就像果冻 宝宝戒夜奶多长时间成功 宝宝20个月宝宝摔着了流鼻血 宝宝害眼老流泪和眼屎 两个月宝宝睡得多吃的少 一岁四个月宝宝牙齿有白色 宝宝黄疸期间发烧怎么回事 20个月的宝宝小腿弯 20个月宝宝打人 9个月宝宝爱玩没食欲 宝宝害眼老流泪和眼屎 胖妈妈生宝宝好生吗 四个月宝宝五天不拉粑粑 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 孤道求索 望枫天地行 特种兵之最强国术系统 为故乡星球而战 万域剑帝 葡京官网 欧博官网 亚星管理平台 葡京官网 皇冠登3出租 二十来天的宝宝拉肚子怎么办 20个月宝宝打人 宝宝20个月宝宝摔着了流鼻血 二十来天的宝宝拉肚子怎么办 二岁宝宝肠胃炎不爱吃东西 20个月宝宝哭呕吐 宝宝害眼老流泪和眼屎 宝宝8个月两边脸颊潮红潮红? 宝宝9个月的疫苗 新生儿宝宝吃奶粉不喝水怎么办 20个月的宝宝小腿弯 新生儿宝宝吃奶粉不喝水怎么办 9个月宝宝爱玩没食欲 宝宝几个月忌奶 宝宝趴在妈妈身上睡图 一岁四个月宝宝牙齿有白色 母乳宝宝用安抚奶嘴 9个月宝宝爱玩没食欲 无创21三体宝宝多吗 小宝宝百天祝福语 六个月宝宝穿多大鞋子 4岁宝宝智力测试表 新生儿宝宝吃奶粉不喝水怎么办 宝宝20个月宝宝摔着了流鼻血 宝宝几个月忌奶 六个月大的宝宝能吃银耳吗 胖妈妈生宝宝好生吗 六个月大的宝宝能吃银耳吗 20个月宝宝打人 四个月宝宝五天不拉粑粑