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
城堡的灯漫画修仙 炼丹 漫画耽美下拉式漫画网3p变身被室友轮漫画染梦梦耽美漫画肉城堡的灯漫画开花记录漫画耽美下拉式漫画网3p呆瓜漫画漫画给树浇热水日本漫画教学书排行榜耽美下拉式漫画网3p耽美攻被调教漫画日本漫画教学书排行榜女汉子调教记漫画184漫画给树浇热水骑士与魔法漫画23帝王侧漫画未删剪帝王侧漫画未删剪侵犯不能动的美女漫画6画风好日本漫画帝王侧漫画未删剪呆瓜漫画拜托御姐漫画全集全职猎人漫画出到哪里照顾小孩漫画图片全职猎人漫画出到哪里拜托御姐漫画全集侵犯不能动的美女漫画6耽美攻被调教漫画男屌丝林凡意外车祸,却不料穿越异界,还未来得及高兴自己重生再世为人。却从记忆里发现自己是一个落漠家族的长子,虽天赋异禀却在17岁遭人偷袭丹田破碎武魂无法凝聚。随着脑海中一道系统提示音响起,林凡便有了称霸异界,问鼎苍穹的意志。还在YY的林凡被系统强制接受任务,悲惨的升级之路,爽翻天的称霸之路,一路美女如云……在这片神州大陆上,分布着五个帝国,修罗帝国位居其中,每一位修罗想要变强就要在大陆各处辛苦历练,历尽磨难不断的提升自己,从而晋升修罗真魂魂力等级,获得相应的修罗封号,然而修罗神神祇只要一个人能晋升成功,让我开启全新的修罗世界吧。太初大陆,强者为尊。 草根出身的天才少年被情人背叛,惨遭杀害,却意外开启了仙帝传承。 从此,丹方、秘法应有尽有,天骄、强者无须畏惧! 练最高深的仙家道法; 去最危险的遗迹寻宝; 泡最优秀的绝色美人! 一路高歌猛进,所向无敌,感悟混沌法则,问鼎仙魔两界!天才少年萧辰,灵台被族人夺取,沦为废人,受尽屈辱,幸而觉醒神物九龙塔,拜得神秘少女为师,吞噬九天之灵,融万族血脉,以九龙之体,战尽天下英豪!绝对控制的力量……时间。 罗克死后,当一块三角形的岩石与他的灵魂融为一体时,他神秘地重生在了舜龙几近死去的身体里,顿时一股信息涌入了他的脑海。 他现在发现自己置身于一个神秘的世界,这里到处都是拳毁高山,剑劈大海的异常强大的修真者! 这就是舜龙在修真界的磅礴征程,他与天才斗智斗勇,成就炼丹与武道的巅峰!这是一个关于女性的故事,在世俗里,女性在抗争,在受害,在爱与被爱,婚姻和伦理,在利益与自私面前张徨失错、泪流满面、血流成河……六道沉沦,天人崩碎 逆天第一人沉睡祖地,沧海桑田,祖地福荫 十万年太久,只争朝夕! 天月金轮,再起天之战!放下执着的念想,当下即得轻松。一位异域少年带着特殊的命运降临苍茫天,龙皇一怒,诸天沉浮,抬指间,一念生死作品将持续更新,以细腻的角度独特的视角来讲述你所不了解的大宋故事以及你所了解的大宋故事中的你所不了解的细节 本书语言风格幽默,学习当年明月,飘雪楼主,六神磊磊的写法平民视角看大宋的力作,白话正说宋代故事
一冒传奇的历险记 十世重生:此世我傲临十方 大千真主 前世仇今生报 我的那些陈年旧事 天下平安 修道,何止于修仙 星海救赎 染指昙花香 巅峰守护神 另一个时空的秩序 复仇男神 西游之开局拒绝大闹天宫 星月沉 三国最强小才子 天狐缘 灵界之下界 修士无双 一骑当千是书生?! 虚假的 修仙都市漫画大全 神医摘女漫画 骑士与魔法漫画23 染梦梦耽美漫画肉 修仙都市漫画大全 斗穹苍穹漫画 骑士与魔法漫画23 漫画回家韩国 照顾小孩漫画图片 客户止步的提示漫画 大贵族漫画475 大贵族漫画475 桥下躲雨遇见阿姨漫画 神医摘女漫画 城堡的灯漫画 染梦梦耽美漫画肉 电玩少女漫画 照顾小孩漫画图片 动态漫画小智 耽美下拉式漫画网3p 神医摘女漫画 耽美下拉式漫画网3p 动态漫画小智 日本漫画教学书排行榜 漫画给树浇热水 桥下躲雨遇见阿姨漫画 修仙都市漫画大全 修仙 炼丹 漫画 动态漫画小智 照顾小孩漫画图片 染梦梦耽美漫画肉 日本漫画肉片学校 变身被室友轮漫画 城堡的灯漫画 拜托御姐漫画全集 全职猎人漫画出到哪里 变身被室友轮漫画 骑士与魔法漫画23 桥下躲雨遇见阿姨漫画 女汉子调教记漫画184 全职猎人漫画出到哪里 客户止步的提示漫画 菜菜子漫画网 电玩少女漫画 日本漫画教学书排行榜 日本漫画肉片学校 大贵族漫画475 全职猎人漫画出到哪里 桥下躲雨遇见阿姨漫画 开花记录漫画 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 不灭之万古仙帝 我来修仙界打金 在末日中生存 天道转生奇异录 云努南江 澳门葡京官网 AG真人 快连下载 澳门葡京官网 欧博官网 耽美下拉式漫画网3p 母扶她漫画 修仙都市漫画大全 斗穹苍穹漫画 照顾小孩漫画图片 骑士与魔法漫画23 染梦梦耽美漫画肉 神医摘女漫画 电玩少女漫画 呆瓜漫画 电玩少女漫画 耽美下拉式漫画网3p 大贵族漫画475 修仙 炼丹 漫画 动态漫画小智 母扶她漫画 漫画回家韩国 照顾小孩漫画图片 变身被室友轮漫画 帝王侧漫画未删剪 染梦梦耽美漫画肉 桥下躲雨遇见阿姨漫画 开花记录漫画 呆瓜漫画 侵犯不能动的美女漫画6 菜菜子漫画网 桥下躲雨遇见阿姨漫画 漫画回家韩国 菜菜子漫画网 女汉子调教记漫画184