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
小说 字数1500如云 炒股 小说武侠小说里出名的情侣人间地狱小说 秀秀韩娱running man小说小说 字数1500有声小说 夜惊魂 196武侠小说里出名的情侣纯阳仙境 羽民 小说梦侦探 小说伊尔 小说小说 字数1500白先生 耽美小说伊尔 小说武侠小说里出名的情侣金甲僵尸 摇滚僵尸 小说豪门艳女 小说韩娱running man小说韩娱running man小说风水小说 京城太子小说 108白衣卫小说 一女多男 男主是五个哥哥纯阳仙境 羽民 小说恶漫小说宝像 小说小王子 有声小说人间地狱小说 秀秀萝莉侄女 小说风水小说 京城太子小说my love张道域作为天师府当代天师传人,奉师命下山肃清妖邪,只是所谓妖邪一定是恶吗?公道自在人心,这是“不谙世事”的张道域在天师府所学不到的,且看张道域游走世间,炼心寻道这是继第一部九转冰魄后我的第二部作品,延续着前一部的故事,主要故事发生在劲文武离开后的两个世界,之后出现了一个更大的强敌,本以为劲文武通过前面一战变得在无敌手,但是后面出现的敌人让大家有点措手不及,劲文武的众兄弟都经过拼死抵抗还是败下阵来,只能希望劲文武能够回过来帮忙一起对抗强敌,但是劲文武是否能够抵挡呢,而接下来众人的结局到底会是如何呢,请拭目以待!黑与白的浪潮中,不知何人在低语……我想挣脱前往那星空的彼端,于暗羽中刻下文明的墓志铭。这个世界有鬼,地府鬼仙,有神,天庭神仙,有灵,人间神灵,有妖,上古妖兽,有佛,诸天神佛,有道,无上道尊,有国,大汉。 身为游戏霸主的李清风,来到这个世界,本想做一个潇洒快活的江湖侠客 囚牢内的一封密函,彻底改变了他的思想,从此在一个名叫“权利”的旋涡内越陷越深黑暗深渊异魔暴动,异魔王横空降世,天澜城危。 “叮。经系统检测,天澜城城主发布雇佣任务,剿灭异魔,是否接受?” “接受。”苏格望着那遮天蔽日的异魔,眼神炽热。 “叮。本着客户至上、任务第一的原则,宿主修为将临时提升到帝境,以便完成任务。” “任务完成,将有十分之一临时修为转化为永久修为,可与宿主原修为叠加。” 于是,人们震惊地看到—— 天澜城外,一剑光寒平地起,亿万异魔成飞灰。 生活是如此的现实骨感,而不经意间进入到了异界却成为我打开生活的一扇门。武侠小说已经衰弱,并且还在一直衰弱下去,这是一个事实。 我喜欢武侠小说,可是现在的武侠文说真的,已经没什么好写的了。 提起“武侠”两个字,每个人都可以想到诸如“门派”、“功法”、“内力”、“招式”或者“宝藏秘籍”,“家国情仇”等等的东西了,说实话,作为武侠文作者,我自己都觉得太过乏味旧气了。 所以或许我还能写出一点,哪怕只有一点点,起码让我自己还能觉得不太乏味的东西。 我不知道我到底能不能写出这样的故事,但是可以肯定,本文一定不会暴爽,更不会爆火,(哈哈……)但是我还是尽量想让自己写出一点有趣又不至太老套的故事,所以如果你对武侠文还有兴趣,也许你可以进来,帮我搞点点击量……嘿嘿…… 女娲造人之时,给予了万物灵性,不管什么生物都有可能有智慧,而所有生物开始发展,并建立各自的体系制度,人类在妖魔的魔爪下生存着,有一天,宠师出现了,这让人类有一丝力量与妖魔斗争……并且得以生存。简介:《爽文、虐恋、修仙》 刚从千年寒冰封印中醒来,就晋升天神巅峰。 因为封印时间太久,虽然侥幸突破神级瓶颈,却空有其表,外强中干,好在天神威名在外,全靠忽悠蒙混过关。 而作为活了两万年的天神阿巫,感情页却是一片空白,在某天救下一名“柔弱”药师起,感情道路可以用崎岖坎坷来形容,这场爱情注定是场悲剧。 感情受到欺骗,被害落入人间轮回,再次历经情劫冲破封印,满级神力归来的阿巫,逐渐揭开上古天神陨落的神界丑闻。 一天重复着一天,当初选择并打算坚持的理想在不知不觉中变了质,面对现实中的种种无奈,不得不放弃一些长久以来所坚持的东西,迷茫的寻找着以后的路,如果有一天我们如众多穿越者那样穿越到不同的世界,我们又能做什么?又能改变什么?(PS:一直答应过一位好友要以他为主角写一本书,虽然好久好久没有联系,毕竟答应过的事情都要做到,人不能无信嘛,本书虽然会写得有些乱,未来可能骂评如潮,但是不会鸽,会坚持写完。)
没有结局之责任 仙路鬼途 封妖万界 主播在线吃鸡 仙帝归来之最强奶爸 暮洛书签 羽化飞升后,我成就万古人皇 神魔在人间 逆仙魔尊 龙族监察军世纪之风 阴魂书 朕继承大周赵大却黄袍加身 魔幻西游释厄记 至尊小仙农 无字天书之仁武天下 俗世仙山 萧木之零神领域 小李飞刀之鬼见愁 第七黑暗 极之竞技 小王子 有声小说 金甲僵尸 摇滚僵尸 小说 盗墓 发丘天官小说 韩娱running man小说 如云 炒股 小说 萝莉侄女 小说 盗墓 发丘天官小说 宋宁 古言小说 浪客剑心 小说 白先生 耽美小说 小说 撕扯 婚纱 小说 撕扯 婚纱 恶漫小说 金甲僵尸 摇滚僵尸 小说 小说 字数1500 宝像 小说 穿越到古代收人妻寡妇的小说 小王子 有声小说 楔子小说 武侠小说里出名的情侣 女主开咖啡店 小说 武侠小说里出名的情侣 楔子小说 小说 一女多男 男主是五个哥哥 梦侦探 小说 傲世九重天 相关小说 小王子 有声小说 楔子小说 楔子小说 浪客剑心 小说 韩娱running man小说 女主开咖啡店 小说 人间地狱小说 秀秀 小说 字数1500 恶漫小说 宝像 小说 人间地狱小说 秀秀 盗墓 发丘天官小说 恶漫小说 伯母 惊艳 风韵 小说 宝像 小说 宋宁 古言小说 风水小说 京城太子 穿越到古代收人妻寡妇的小说 伊尔 小说 女主开咖啡店 小说 小说 撕扯 婚纱 宝像 小说 傲世九重天 相关小说 豪门艳女 小说 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 蓑衣 开局表白百次,我绝不放弃 离开人间到哪去 御神令 我真不是天道啊 亚星游戏官网 万利游戏官网 万利官网 亚星游戏官网 葡京官网 金甲僵尸 摇滚僵尸 小说 宋宁 古言小说 豪门艳女 小说 穿越到古代收人妻寡妇的小说 如云 炒股 小说 人间地狱小说 秀秀 金甲僵尸 摇滚僵尸 小说 风水小说 京城太子 韩娱running man小说 萝莉侄女 小说 梦侦探 小说 伯母 惊艳 风韵 小说 小说 撕扯 婚纱 小说 撕扯 婚纱 白先生 耽美小说 小说my love 女主开咖啡店 小说 梦侦探 小说 小说 一女多男 男主是五个哥哥 盗墓 发丘天官小说 楔子小说 伯母 惊艳 风韵 小说 女主开咖啡店 小说 小说 108白衣卫 宝像 小说 浪客剑心 小说 梦侦探 小说 武侠小说里出名的情侣 穿越到古代收人妻寡妇的小说 穿越到古代收人妻寡妇的小说