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
大龙邮票上海邮票网十二生肖邮票纪念邮票邮票网大龙邮票鸡年邮票中国邮票女幽灵 百度网盘下载 迅雷下载邮票行情五代十国,乱世风云,后周显德年间,佛劫降世,佛门高僧入世消劫,引发了诸多江湖儿女的家国情仇,为天下太平演绎岀荡气回肠的传奇故事……   寂寂夜空孤月寒,十七年离别茫茫。一念执真,南风绿依,盛颜银发证衷肠。   最是有情“负情蛊”,三年生离道心初。剑啸弦荡,逍遥慕云,一念倾情一生终。   啸引苍波,漫卷山河,心志难酬朱颜改。孤情骄阳,若玉独镜,小楼空照人何在?   日月无改江山裂,金戈铁马雁泣血。渊鱼更龙,世宗执戟,风起云涌荡山岳……   一缕清风,人间太平吹拂……高阳原本是个蓝星的雇佣兵,在一次执行任务中来到了金庸武侠世界--神雕。 在神雕世界中获得武林中人梦寐以求的武林秘籍,左手六脉神剑、右手降龙十八掌,年纪轻轻就达到别人一辈子的成就, 一个小小的蝴蝶能带动多大的效应?神雕世界因为高阳的到来又会有什么样的变化?神雕中的爱恨情况是否因为高阳的到来而改变? 让我们走进神雕世界,看高阳如何在江湖中翻云覆雨~~~~~ 各位书友要是觉得《神雕之我是大魔王》还不错的话请不要忘记向您的朋友推荐哦古一白这一生运气很好,有爱人,亲人,知己,红颜,朋友,兄弟,…… 也守护了很多,失去了很多!天界至宝天神之怒碎裂成两半,从此消失不见,天界由此陷入混乱。要想天界恢复秩序,必须寻回天神之怒。在天界遍寻无果之下,众天神不由束手无策。 红哥是传奇游戏中的一头红野猪,因一次意外事件获得了传奇外挂一枚,原本只想升职加薪、当上业务主管、迎娶白野猪的他,从此打开了新世界的大门 2034年,位于华夏北方的俄国突然联合死敌M国攻打华夏,后发展为第三次世界大战。一切都来源于一个巨大的利益旋涡,一场牵扯了整个蓝星文明的阴谋逐渐浮出水面......慕青寒申的力作《次元人》次元应该都不陌生,人们创造了二次元,现实中是一次元还有那我不知道的三次元,但有人能去其他次元里面吗?答案是有,主角名叫徐国风,是一位可以穿梭到任何次元的人,俗称次元人,看起来好像没什么暖用,但却能改变次元中所有人的命运。可是等着他的,却远远不止这些……横推都市无敌手,轩辕重开林仙人。 灭门之仇,断腿之恨,血海深仇,不报难安! 我林枫修仙归来,你们这些练武的也配?清露星辰动荡,少年强势崛起。 强大力量扶持,一路长歌风卷残云。 战将诸星浴血奋战,热血洒遍星宇...... 明末边境倭寇匪患猖獗,朝廷剿灭不力,黎民水深火热,时事从民间择选了一草根步步成王,力挽狂澜,只是这个成长过程有些让人惨不忍睹。
邮票图片 猴年邮票 邮票图片 邮票互动网 中国邮票价格表 邮票市场 邮票互动网 邮票行情 十二生肖邮票 女幽灵 百度网盘下载 迅雷下载 邮票吧 邮票 邮票交易所 鸡年邮票 中国邮票价格表 纪念邮票 中国邮票 邮票价格 生肖邮票 民居邮票 生肖邮票 大龙邮票 龙邮票 邮票互动网 欧美群迅雷下载 龙邮票 邮票 邮票图片 南京文交所钱币邮票交易中心 邮票收藏 香港回归纪念邮票 纪念邮票 生肖邮票 邮票 文革邮票 猴年邮票 邮票收藏 香港回归纪念邮票 女幽灵 百度网盘下载 迅雷下载 邮票交易所 爱面子的克里斯托先生黑色的王座我无限流玩成了都市文旧城小店傲娇师尊爱上我动物变形记:基因突变巨兽风暴钦海城风云再读一次初中最后一个端公末世最强混子组织黑白无常叫我小先生人化灵传海贼之五雷正法都市守夜者星核之小兵狂想曲一定不会放过你变身修仙女战皇我家超市通两界孤夜辞亚星游戏官网 亚星游戏官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 【薇-電132-②⑧⑧⑧-8433】皇冠登3出租 【薇-電132-②⑧⑧⑧-8433】皇冠登3出租 【薇-電132-②⑧⑧⑧-8433】皇冠登3出租 【薇-電132-②⑧⑧⑧-8433】皇冠登3出租 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 快链加速器 - 上海曲德曲网络科技有限公司 快链加速器 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链加速器 - 上海曲德曲网络科技有限公司