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
上海邮票网奥运邮票中国邮票第三轮生肖邮票纪念邮票中国邮票价格表邮票交易所第三轮生肖邮票中国邮票邮票互动网我没有太大的理想,生活在一个平凡的世界。没有重生穿越,没有异能修仙,只是经历着大多数人经历过,或者正在经历的事情。我只是在讲一个故事而已,有我的故事,也有身边人的故事。但生活其实也就那么回事,套用托尔斯泰在《安娜·卡列尼娜》中的那句名言就是:“幸福的生活都是相似的;不幸的,则各有各的不幸。”无良中介坑骗老人,周铭受到老人恳求举报讨回血汗钱。 周铭:众老放心,不就是要个钱?简单! 三日后。 无良中介团伙被判诈骗罪,十年起步! 孙奶奶:只是让你举报要钱,全给送进去了? 牛爷爷:牛哇!牛哇!比我牛爷爷还牛! 某不知名老人:你缺媳妇不,把我家孙女介绍给你! ...... 父母遭到恶毒亲戚碰瓷...... 周铭:进去反省反省! 女警官遭到键盘侠网暴...... 周铭:你以为隔着屏幕我就抓不到你? 天下不平事太多! 我,周铭! 平定天下不平事!乾坤天地,层次分明,修士修行即为修法的过程,修士修法,即为修武法、道法、命法之层次。普通少年莫恒从修武法开始,一路披荆斩棘,高歌猛进,闯荡乾坤天地。要是真的对生活没有办法了,就把有关别人命运的事背在自己身上吧。因一部可修身成神的圣典,全宗被灭。 为报仇雪恨,蓝夜忍辱负重,一路披荆斩棘,历尽九死一生,只为寻得神兽传承。 发小死于眼前,蓝夜怒弑皇族。 为救天下苍生,力抗域外入侵者。 待得天下安定,却发现更严峻的挑战在等着他。。。。。。末世+自然灾害+无系统+求生 气候突变,打破了世界原有的平静,冰川时代降临,幸存者挣扎求生。 面对未知的灾难和危险,一个个小人物组建到一块,共度危机,只为在这末世之下,走的更远自上古以来,能长生久视者寥寥无几。如今星河异动,或许正是成仙的大好时机。少年星轲,怀懵懂入世,经生离死别、历万丈红尘,最终能否不醉星河?前路凶险万分,稍有不慎,便可能黄土不成。等待他的,是“云梦虚”、“生死妄”、“阎罗判”以及……古陵穿越仙武世界,成为道宗被废弟子。被打入禁地渊薮,觉醒签到系统。 “叮!签到成功,恭喜宿主获得先天圣体道胎!” “叮!签到成功,恭喜宿主获得元辰精神术!” 一百年后,修行界大乱,在古陵走出禁地的时候,豁然发现,自己举世无敌。如果有一天,当你睁开了惺忪的双眼望向这个世界。你还未来得及称赞这一觉睡得那样充足饱满,床垫是有多么的柔软舒适,取而代之的则是你的家园、你赖以生存的那座城市消失不见的恐惧。除了你自己以外的任何人都没有了关于那座城市的认知,你所有的找寻都无功而返,这个和世界没有了丝毫那座城市曾经存在过的迹象。你会相信并接受这个世界的改变还是会坚持自己的主见?如果有一天,你触发了“X-隐没”的故事,你会怎么办?简介:本该人生平平无为的主角,从一个性格柔弱到脱变成刚毅的成长故事,后来主角从这跌宕起伏的生涯中成就无上荣耀。
纪念邮票 邮票价格 欧美群迅雷下载 邮票价格 奥运邮票 邮票收藏价格表 南京文交所钱币邮票交易中心 香港回归纪念邮票 世界上第一枚邮票 中国邮票 猴年邮票 大龙邮票 邮票交易所 南京文交所钱币邮票交易中心 女幽灵 百度网盘下载 迅雷下载 上海邮票网 上海邮票网 香港回归纪念邮票 上海邮票网 邮票吧 奥运邮票 邮票图片 欧美群迅雷下载 邮票吧 邮票市场 邮票行情 猴年邮票 大龙邮票 世界上第一枚邮票 生肖邮票 邮票收藏价格表 中国邮票价格表 邮票收藏 邮票互动网 邮票收藏价格表 邮票价格 邮票网 猴年邮票 邮票价格 鸡年邮票 坦荡的征途自由勇者的异世界冒险万里山河皆尘土日月扉满级霸婿有点甜剑飞大陆玄幻:我能提取血脉之力被当成废人传送到异世界?这真是一本正经的鉴宝书?残缺的彼端 c暮墓1 圣殿传说月照梅花我王凡没有开挂赘婿之绝品帝尊荒,我真的绝望了重生之我是张鸡豪向世界说你好二次元之我的系统有点妖彼岸落笔少主凯歌亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星游戏官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 【薇-電13228888433】皇冠登3出租 【薇-電1322 8888 433】皇冠登3出租 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 【薇-電1322 8888 433】皇冠登3出租 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 快连VPN - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司 Lets快连 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司