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
Congwu游戏最新的团队游戏大全Congwu游戏团体外出玩的游戏比赛最后对决 游戏逃脱游戏在线笆比娃娃小游戏追女朋友的日本游戏适合小孩玩的剪发游戏越狱游戏视频攻略做披萨玩游戏的做披萨逃脱游戏在线做果冻的游戏做披萨玩游戏的做披萨追女朋友的日本游戏越狱游戏视频攻略4399打丧尸游戏大全最佳游戏位置送熊大回家选关版最佳游戏位置送熊大回家选关版最新烧脑小游戏Congwu游戏最佳游戏位置送熊大回家选关版6岁宝宝游戏下载地址最好玩的数学游戏最后对决 游戏双胞胎逃脱游戏团体外出玩的游戏比赛双人飞碟游戏孙悟空动作小游戏做果冻的游戏末日来袭,地球上的植物与水源全部枯竭衰败。 世界陷入恐慌,秩序与人性崩碎。 食物与生存,再次成为新世纪之后人们最关心的话题。 米面成为奢侈品,唯有富豪才能享用,菜蔬更是身价暴涨万倍,有价无市! 然而就在此时,有人捡到了一部手机,偶然打开之后,手机内的视频令世界震惊。 甘甜的菜蔬滚入火锅之中,散发着诱人的绿色! 烤的金黄的羊腿滋滋冒油,沾上芝麻般的孜然! 鲜美的鱼汤炖的宛若牛奶一般纯白,撒上翠绿的葱花! 饭桌旁,一名粉雕玉琢的小女孩咬掉半颗草莓,哀求道:哥,我真的吃不下了!! 张锋嚣 天魔禁我灵魂三十春秋 苍老归来 那又如何 看我笑谈方寸 剑指秋华 此世 必有我张锋嚣 傲然奢华 戏弄苍穹之绝世神姿 在一个修科和修炼的世界里,有许多修炼科目与修炼武功的人,朱后然诞生在这个世界上这是关于一个梦……大地初开,灵气应运而生,以灵气之力,然后神得以化形,而所剩之灵气皆化为人,然神族视人族为蝼蚁,肆意践杀,天地为之不容,故以天地之力孕育一人族,其名曰:青阳。青阳出,神族灭。然神族万年一轮回,万年后神族回归,人族又将何去何从?魂穿崇祯却发现自带华夏图书馆,整顿吏治,训练新军,平内安外,科技强国第一步先从留住魏忠贤开始。 东林意图众正盈朝?可曾问过厂卫刀还利否? 鞑子于辽东意图糜烂中原?可曾听闻枪与火炮轰鸣? 东瀛时常滋扰海防?与其日日提防不如给大明添座石见银山? 知识改变世界,放牧北美,开矿澳洲,殖民印度,脚踩东欧。 枪炮铸我铁血大明,科技铸我宏图盛世。 朱由检:海内诸国,皆为臣属,有明一朝,日月不落。在渐渐步入和平的大陆上,阴谋于野心藏于不可见的黑暗中。本来应在棋盘之外的无逝,意外的卷入纷争。少年历经打磨成为锋利的刀,劈开棋盘,走向属于他自己的远方。   为了想要去到的方向,少年肩负着亲人朋友的希冀。   “在没到达尽头之前,我不会停下!” 妖乱末世,巨兽屠城,万妖夜行,人间如狱。 神秘少年,半妖之身,踏上猎妖风云路,书写一代妖相传奇! 且看他,猎妖、除魔、斗巨鳖、擒天龙、佐明君、征天下、运筹帷幄、纵横捭阖、荡除妖兽、平定末世!人活着无论干什么都挺困难。即使坚守不招惹人的原则都躲不过被人刁难。即使是对的,在金钱和权力的逼迫下变成了错的。人活着是最痛苦的事了,压抑的怒火早已烧毁了心脏。人需要发泄的地方,请来疯狂直播间。少年被家族遗弃,遭受刺杀修为被废。 危难之际开启镇魂世界,神秘女子百般磨练,终修剑道。 自此修行坦荡,领悟无上剑道,修不灭剑体。 修武技,破苍穹,入圣域,掌握天下权,醉卧美人膝,翻手为云,覆手为雨, 轻挥手中剑,剑出移山镇海,诸天星辰陨落,横断八荒四野; 九洲雷霆动,剑气侵万古,临绝世剑神。
异界血刀行 私家侦探之小人物 诡事慢谈 群英缪传 极道帝师 末日终结之废土求生 封魔录之天地裂变 以凡入道决 肥宅逆袭史 影视之万界穿行 都市亦邪 神祇:独步仙魔 赠送宝物,抽奖反馈 全网狂黑,我逆流而上 末世诸天进化 神医小村民 仙海逆程 神医下山:我的绝美未婚妻 辞职去当玄术师 大唐腾飞之路 做果冻的游戏 最新烧脑小游戏 最佳游戏位置送熊大回家选关版 紫色的游戏游戏人物 做果冻的游戏 笆比娃娃小游戏 最近还好玩的小游戏 逃脱游戏在线 4399冰雪奇缘双人游戏大全 兔子吃胡萝卜闯关游戏 2人玩的小孩游戏下载游戏 做披萨玩游戏的做披萨 4399小游戏换衣服 最新烧脑小游戏 适合小孩玩的剪发游戏 紫色的游戏游戏人物 最近还好玩的小游戏 4399冰雪奇缘双人游戏大全 最囚游戏十三季 Congwu游戏 最新烧脑小游戏 守门小游戏 最新的团队游戏大全 最好玩的数学游戏 真人游戏动漫 4399小游戏换衣服 4399冰雪奇缘双人游戏大全 最新的团队游戏大全 最囚游戏十三季 4399冰雪奇缘双人游戏大全 紫色的游戏游戏人物 最新烧脑小游戏 摔坑爹的游戏规则 适合小孩玩的剪发游戏 4399打丧尸游戏大全 紫色的游戏游戏人物 摔坑爹的游戏规则 最佳游戏位置送熊大回家选关版 4399小游戏换衣服 守门小游戏 双胞胎逃脱游戏 追女朋友的日本游戏 6岁宝宝游戏下载地址 做披萨玩游戏的做披萨 最好玩的数学游戏 最新烧脑小游戏 做披萨玩游戏的做披萨 双胞胎逃脱游戏 4399小游戏换衣服 最后对决 游戏 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 正值青春萌动时 众仙带我飞 虎踞新纪元 正太老师的日常生活 那些年的深刻记忆 澳门葡京官网 快连下载 欧博官网 澳门葡京官网 欧博官网 最新烧脑小游戏 团体外出玩的游戏比赛 笆比娃娃小游戏 Congwu游戏 越狱游戏视频攻略 4399小游戏换衣服 最近还好玩的小游戏 摔坑爹的游戏规则 4399冰雪奇缘双人游戏大全 真人游戏动漫 真人游戏动漫 双胞胎逃脱游戏 紫色的游戏游戏人物 Congwu游戏 守门小游戏 4人小游戏室内 孙悟空动作小游戏 兔子吃胡萝卜闯关游戏 孙悟空动作小游戏 团体外出玩的游戏比赛 4399打丧尸游戏大全 真人游戏动漫 Congwu游戏 最佳游戏位置送熊大回家选关版 最好玩的数学游戏 做果冻的游戏 做果冻的游戏 真人游戏动漫 真人游戏动漫 双人飞碟游戏