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
邮票图片邮票网邮票收藏邮票价格民居邮票邮票交易所南京文交所钱币邮票交易中心世界上第一枚邮票民居邮票欧美群迅雷下载本出生自皇族的唐天皇,却有家难回,名有着强大的血脉,却要隐藏于世……张落日异世修炼一千八百万年,追杀三千无影群魔,心魔缠绕,一缕神魂穿越时空,附身前世,开启大道重修之路——本部为第四部作品,多人创作重生在了天道即将崩溃,鸿钧三清远走寻到,天地王母受援以进,现代科技飞速发展,对于修行却是半开放的世界,江屹煊被选为了复苏天道的棋子。 对于这些,江屹煊有话说:“我只想把仙丹当糖豆,把八九玄功当炼体术,让亲人无病无灾。用真火来炒菜,用灵泉当家庭饮用水,让石材释放出它最美味的口感。对于复苏天道什么的,谁爱作谁作,我没兴趣!”晚自习我们班突然收到一封来信,它要和我们玩游戏,并且给每个人都发了红包,看着微信里多出的余额,我们毫不犹豫地在信上按了手印,接下来,怪事接连不断地出现在我们班,迎接我们的只有绝望。我们好像置身棋盘中。这盘棋意义何在?又将何时结束?身为棋子的我们又能做些什么……大千世界,精彩绝伦,少年江辰不甘平淡,修炼篡改少年命,逆境险象皆环生,敢于苍天试比高,敢与大地撼乾坤,蜕凡涅槃终成圣,问鼎苍穹诛魔尊!时代变迁、科技发展,当蓝星已经越来越无法满足人类发展的需求时,宇宙大航海时代呼之欲出。 大学生刘传无意之间获得了超级文明种子,从此带领天河文明走出蓝星,探索星辰大海!赵凡穿越成为赵家帝子,本以为是高端华丽的开局,却没有想到前身遭人狙击帝血散尽境界跌落,成为无法继续修炼的废人。 就在赵凡绝望之际,模拟修仙系统绑定成功,每次模拟人生都可以获得系统给出的奖励。 “模拟成功,奖励真龙宝药。” “模拟成功,奖励永恒战甲。” “模拟成功,奖励太玄帝经。” …… 五百年后,赵凡打破了万古神话证道成帝,恐怖的帝威,肆虐九天十地!流水线工人意外穿越至异界,开启了他的一段传奇人生。 灵气复苏,诸天入侵,蓝星沦为诸天万族的练兵场。少年江淼自微末中崛起,靠着天赋与智慧,成就一方霸主,带领人族征战诸天。
香港回归纪念邮票 中国邮票价格表 邮票收藏价格表 邮票收藏 世界上第一枚邮票 龙邮票 生肖邮票 大龙邮票 邮票网 中国邮票价格表 文革邮票 上海邮票网 鸡年邮票 香港回归纪念邮票 世界上第一枚邮票 十二生肖邮票 邮票交易所 民居邮票 邮票互动网 南京文交所钱币邮票交易中心 中国邮票 邮票吧 邮票行情 中国邮票 生肖邮票 邮票行情 中国邮票 鸡年邮票 第三轮生肖邮票 邮票收藏价格表 上海邮票网 邮票互动网 奥运邮票 生肖邮票 邮票吧 邮票行情 邮票互动网 奥运邮票 邮票网 大龙邮票 只有我能杀死诡!我们走过的十年末路狂谍葬音者抚顶红尘梦终焉之路我有空间千顷田上仙武乘风飞来大财运大国重器智能时代厨子不风流为武林除害当码农遇上系统世无殇同世而立熬死所有人,我终于无敌了仙家聊天群藏武末世之开局觉醒超神天赋紫微星现世亚星游戏官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 快链加速器 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司 Lets快连 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 Lets快连 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 Lets快连 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司 亚星游戏 亚星娱乐 亚星国际