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
文革邮票鸡年邮票邮票互动网邮票收藏香港回归纪念邮票文革邮票世界上第一枚邮票大龙邮票欧美群迅雷下载中国邮票价格表一个二十一世纪的屌丝,刚完成一单新闻,猝死出租屋,还不知道有没有人收尸就来到了楚国,一个有着宋的憋屈明的铁血的平行空间还是异世界?总之不小心成了异性王唯一的子嗣,可能出场姿势不好,被人用锤子打出了的。周边都是贼兵蛮子鞑子,好在有后世的天线一条,不至于被古人玩死成为最惨穿越者,一路泡妞打蛮子,没事就种种地!当然是真的种地。上一秒还在午休的我 下一秒我睁开眼睛发现一切都变得陌生 我新买没有一个星期的空调呢,没有你我该怎么活 不对,现在我应该在梦里。 可是为什么被打会这么疼 够了,住手。想知道是不是做梦你不会打自己呀 我一脸无语看着刚认识不久的网红小姐姐叶平穿越到妖魔横行的世界,成为了斩妖除魔天玄靖安司的一名值夜者,身附伴生青囊,只要救人就能获得对方生命中最宝贵的东西。 灵丹妙药、绝世功法…… 妙手医百病,丹心斩妖魔,他是这人间的神,亦是诸天万族的劫妖乱末世,巨兽屠城,万妖夜行,人间如狱。 神秘少年,半妖之身,踏上猎妖风云路,书写一代妖相传奇! 且看他,猎妖、除魔、斗巨鳖、擒天龙、佐明君、征天下、运筹帷幄、纵横捭阖、荡除妖兽、平定末世!穿越到天龙世界的屌丝,凭着对原著小说的耳详能熟,是选择修炼成绝世高手还是辅助原著主角成就霸业?不,武功要练,最重要的是篡改剧情,别让乔峰自杀…三年前,大婚之日,他遭人暗算,被人投江。   三年后,他脱胎换骨,再临故地。   这一次。   他绝不会再让任何人主宰自己的命运.....神奇的异世界,斗气与魔法交相辉映。 人族,龙族,兽族,神族,魔族,精灵族,亡灵族,百族混居。 一介孤儿,如何在这乱世生存? 历经磨难,步步为营,只为坚持自己的梦想! 我要踏足魔法之巅! 很久很久以前,有一座山,名为葬灵山;葬灵山的西边有条渊,名为无相之渊;无相之渊的西边,有一座学府,名为真武院;而故事,则要从葬灵山东边的那座凌天帝国讲起……每一个地方都会产生一些光怪陆离的故事,它们不被记录在书本上只流传在每个人的口口相传中,而这本书将会为你打开一扇你从来未曾听闻过的奇异人文。每个人的一生都是现场直播!小普通也是很好的剧本!感人的亲情,青春的爱恋,热血的兄弟情,一幕幕都历历在目!普普通通的新晋高中生--王南,初进高中校园,遇到的那些人那些事!让我们用小人物的故事,说出普通生活中的感动!
龙邮票 十二生肖邮票 邮票吧 邮票互动网 十二生肖邮票 南京文交所钱币邮票交易中心 邮票行情 中国邮票价格表 邮票行情 鸡年邮票 十二生肖邮票 邮票图片 邮票价格 世界上第一枚邮票 中国邮票 邮票收藏 大龙邮票 邮票网 第三轮生肖邮票 猴年邮票 第三轮生肖邮票 文革邮票 纪念邮票 邮票交易所 邮票 纪念邮票 邮票图片 邮票吧 邮票行情 邮票市场 南京文交所钱币邮票交易中心 邮票收藏 第三轮生肖邮票 邮票图片 邮票收藏价格表 上海邮票网 邮票市场 南京文交所钱币邮票交易中心 欧美群迅雷下载 邮票价格 信使的传承十方天陆圣灵星皇子到地球做大少我携三千诗书修圣人凉城小炮灰道门天才废土从超级基地开始轩辕七杀专生避免成为主角的我帝玄纪元世纪:暗尽天明剑中缘 孙笑川258轮回之孽,九世之缘九域劫主勤劳勇敢的渔夫元界至圣掠过环宇之巅子星记圣钰修仙致富系统亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星游戏官网 【薇-電1322 8888 433】皇冠登3出租 【薇-電1322 8888 433】皇冠登3出租 【薇-電1322 8888 433】皇冠登3出租 【薇-電132-②⑧⑧⑧-8433】皇冠登3出租 【薇-電13228888433】皇冠登3出租 Lets快连 - 上海曲德曲网络科技有限公司 Lets快连 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链加速器 - 上海曲德曲网络科技有限公司