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
修魂记小说网游之传世传奇录 传世神天 小说投资2 月关 小说一球惊人 大头呆子 小说江山美人志 小说修魂记小说凤瑶小说网投资2 月关 小说李峰 小说苦役小说一本小说是写主人公吃了一个珠子能变成兽好像叫什么百变兽尊出现修魂记小说犯罪小说 要有推理的 真实的一本小说是写主人公吃了一个珠子能变成兽好像叫什么百变兽尊出现投资2 月关 小说苦役小说格格吉祥 小爷乱入 小说江山美人志 小说江山美人志 小说稻花十里香 万人不迷 小说夕阳毒·痴情未央 彼岸如梦 小说远古神兵之死亡森林 啊啵?? 小说李峰 小说恶魔小姐pk天使殿下 悦晓熏 小说月皇的宠妃 夏日紫 小说强娶 小说一球惊人 大头呆子 小说火影一部同人主角是佐助的弟弟跟随六道仙人的遗迹到达异界的小说稻花十里香 万人不迷 小说有声小说叶男护士转生异世界,竟然被职业评定选择成了最稀有职业-男性圣职者?本来以为可以在异界享受人生,迎娶公主,走上巅峰,没想到卷王居然就在我身边?内卷什么的之前已经受够了!为了对抗内卷,全都点了治愈,男圣职者平凡而又非凡的异世界生活,从现在开始!  万族入侵,人族求存!   这是一个可修超凡的世界,万族皆从圣墟之中熔炼元魂成为修灵者。   顾北辰携带圣图来到此方世界,一步一个脚印登顶人族至尊,威压诸天万界……   穿越神灵大陆后,林不凡被迫下嫁给一头母老虎,还是一头动不动以死相逼的冷傲暴力母老虎。 面对即将到来的家暴日子,这让林不凡感到很绝望。 幸好,神级选择系统成功激活。 穿越这事没得选,但要下嫁暴力母老虎,林不凡决定做一个以理服人的有为之人。 “叮!感知到宿主诚挚叫大爷,神级选择系统激活。” “选择:强行亲她,奖励至尊道体、太古神诀。” 婚礼现场。 “选择:怒怼万族来宾,奖励百年修为、破妄之眼、太上炼丹术、涅槃真丹。” 林不凡答应……还是拒绝呢? 答应是作死,拒绝貌似不能够。 于是…… 一次机遇之下少年重获再活一世的机会来到了一处崭新的世界,这里没有花俏绚丽的魔法,人人却都崇尚修炼魂力,修行极其艰难却不断有人前仆后继,因为命运的安排少年同样踏上了这条永无止境的道路那他又会到达怎样的地步?这其中又会有多少命运的羁绊?又会有多少的艰难与辛酸...... &amp;lt;万界魂破&amp;gt;是我的第一本书,所以希望承蒙各位读者的关心 懒得介绍秦风被迫从游戏界龙头企业辞职后,加入了一家只有几个人的小公司。 制作游戏,我秦风还没服过谁。 看不起小游戏?《开心消消乐》《神庙逃亡》教你做人。 单机游戏没落了?仙剑系列,魂系游戏,剧情或难度,总有一款玩哭你。 网游模式单一?LOL,绝地求生,自走棋,这回不是打怪升级了吧? 就凭做游戏,也能做首富! 不信?做给你看!天道俯视众生,凝聚世间万法打造九重天阙,与之共鸣者可获天赐命魂,踏上修行登天之路。 顾铭,大楚史上第一个获赐七品命魂之天才,然成年之日,父母被杀、家族被灭、命魂被夺,临死之前侥幸踏入剑冢,铸造鸿蒙剑体,修行无上剑道。两年之后,顾铭离开剑冢重返世间,踏上剑道至尊之路,一剑可斩仇敌、可破九天、可镇诸天万域。一个宅男穿越到日本战国时代,逢凶化险,不断适应成长的历险故事。进入这家书店时,摆在面前的只有两条路:是选择甘于现状,过着后悔不已的生活;还是选择把自己的故事讲出,换取截然不同的结局。你将如何抉择?孤烟灼,大漠凉, 千绝弃吾伤,无人伴身旁。 万物若寒光,无处暖心房。 纵有心头怀热血, 不抵寒夜浸魂霜。
冰霜长流 文学杂记 我的一米书屋 曙光之壤 离鸿少年游 三国之青山依旧 穿越还是穿刺 新北斗七星剑 大秦,纵横无敌 剑狂无酒 我不止是个御兽师 云努南江 王之路! 浪客断夜行 大结局了才发现我是穿越的 我喜欢的女孩子们 九阙之歌 阴阳先生葛天冲 铁血青州 众神的人间日记 网游之传世传奇录 传世神天 小说 苦役小说 格格吉祥 小爷乱入 小说 江山美人志 小说 网游之传世传奇录 传世神天 小说 狼皮图 小说 女主的名字叫钟离的小说女主是杀手代替别人要求到最后只剩一人 荒诞时代 敏感词 小说 狼皮图 小说 犯罪小说 要有推理的 真实的 穿越小说 惑妻 穿越小说 惑妻 恶魔小姐pk天使殿下 悦晓熏 小说 苦役小说 修魂记小说 月皇的宠妃 夏日紫 小说 黑衣女人 小说 强娶 小说 类似诛仙 仙剑神曲的小说 修魂记小说 p小说 投资2 月关 小说 类似诛仙 仙剑神曲的小说 远古神兵之死亡森林 啊啵?? 小说 荒诞时代 敏感词 小说 死神方程式 小说作者:浮云团子 强娶 小说 类似诛仙 仙剑神曲的小说 夕阳毒·痴情未央 彼岸如梦 小说 强娶 小说 江山美人志 小说 p小说 一球惊人 大头呆子 小说 修魂记小说 恶魔小姐pk天使殿下 悦晓熏 小说 月皇的宠妃 夏日紫 小说 英雄传 押韵 小说 女主的名字叫钟离的小说女主是杀手代替别人要求到最后只剩一人 恶魔小姐pk天使殿下 悦晓熏 小说 英雄传 押韵 小说 月皇的宠妃 夏日紫 小说 神秘少女遭遇邪恶天王:遵命女王陛下2小说 稻花十里香 万人不迷 小说 黑衣女人 小说 一本小说是写主人公吃了一个珠子能变成兽好像叫什么百变兽尊出现 p小说 穿越小说 惑妻 月皇的宠妃 夏日紫 小说 死神方程式 小说作者:浮云团子 凤瑶小说网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 西安新青年 遮天帝神 荒山战纪 六界圣魔录 天位之龙 澳门葡京官网 AG真人 欧博官网 澳门葡京官网 欧博官网 一球惊人 大头呆子 小说 黑衣女人 小说 稻花十里香 万人不迷 小说 江山美人志 小说 火影一部同人主角是佐助的弟弟跟随六道仙人的遗迹到达异界的小说 荒诞时代 敏感词 小说 投资2 月关 小说 火影一部同人主角是佐助的弟弟跟随六道仙人的遗迹到达异界的小说 黑衣女人 小说 犯罪小说 要有推理的 真实的 有声小说叶 p小说 荒诞时代 敏感词 小说 远古神兵之死亡森林 啊啵?? 小说 女主的名字叫钟离的小说女主是杀手代替别人要求到最后只剩一人 类似诛仙 仙剑神曲的小说 英雄传 押韵 小说 p小说 死神方程式 小说作者:浮云团子 月皇的宠妃 夏日紫 小说 狼皮图 小说 荒诞时代 敏感词 小说 投资2 月关 小说 黑衣女人 小说 黑衣女人 小说 一球惊人 大头呆子 小说 月皇的宠妃 夏日紫 小说 修魂记小说 苦役小说 江山美人志 小说