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
曲阜供热服务电话贵阳必胜客外卖电话陕西杨凌名都商务酒店电话赤峰馨风雅居物业电话中关村医院保健科电话曲阜供热服务电话国航电话销售服务中心陕西杨凌名都商务酒店电话乐山阙记粑店电话厦门国际机场电话昆明火车站客服电话是多少曲阜供热服务电话昆明海鸥手表售后电话昆明火车站客服电话是多少陕西杨凌名都商务酒店电话浠水环通客运站电话岘港电话卡机场多少钱中关村医院保健科电话中关村医院保健科电话崇阳到赤壁的士电话八方达调度室电话昆明永都酒店电话乐山阙记粑店电话兰博音乐烤吧电话连云港颐家温泉前台电话上海携程国旅电话赤峰馨风雅居物业电话商丘快餐外卖送餐电话崇阳到赤壁的士电话莒县肯德基电话青春是勇于尝试的,青春是不惧困难的,青春是追逐梦想的......一部自信的小说开元城第一天才周宇,纳元九重,突破之际,被人重伤垂死,根基重创,沦为废材,受尽侮辱的他,又该何去何从  我徐阳穿越异能世界,激活神级异能,从此成为战神。 我   《飞龙乘云》带你回到夏朝末年,感受当时八方诸侯背叛,四藩异族作乱的动荡年代。看主角们如何面对忠义难存的局面,又作如何选择。本书不仅以夏朝为背景,还收录了大量神话故事、历史典故作为故事展开的桥梁,更以漫画般的手法描述激烈的仙术秘术激战场景,还有尔虞我诈的宫廷斗争、江湖侠义的恩怨情仇等一系列热血、谋略、兵道、爱恨尽归此书!欢迎大家以一个开放的心态来收看。 连着几日的噩梦,心情说不得愉悦,倒也算不得痛苦。梦境中几个片段宛若一个个真实的故事。索性把他们写下来,分享给大家。整理一番后,共计出了八篇琐碎的杂文,分别是《重生》、《桥王的最后一状》、《星光马戏团》、《女神像与死亡钟摆》、《嘲言》、《平凡者的小 欢喜》、《守墓人》、以及终章《荒塔》,多希望在终章时我依旧是个名不见经传的小作者,这样我的心事便无人能知…… 两世为人,为了阻挡异族入侵,诡异横行的异世界中,夜风流化身二流骑士,肉身锤怪,一路秒..喵喵。 中二少年的奇幻之旅,假面骑士的视觉盛宴! (前面都是假的,其实就是吐槽吐槽码字挺累的,大家送送礼物啥的。) 一个从小就没有丝毫灵力的废材少年,在一次偶然的机遇下得到高人的指点,由此开启了灵识并慢慢孕育出了只存在于灵修灵海之内,并且需要经过反复发掘和巩固之后才能孕育出的灵冢。 在一向以强者为尊的仙灵大陆上,灵修的修炼层次和速度完全取决于自己灵冢的优劣程度。一般来说,一个灵修灵海里只会孕育出一个灵冢。而被外人都称之为废物的他,灵海里竟然孕育出了两个灵冢,由此也开启了他的万世传奇之路。简介:红孩儿桀骜不驯,屡次不听教诲,被观音罚下人间,沦落成稀有动物。历经磨难,终于明白以强欺弱的严重后果。在奄奄一息之际得到观音的点化,可以重新为人,开始人间一个接一个的奇缘……这是一个游戏技术迭代迅猛的时代。 从红白机到电脑,再到VR技术的问世,不过一代人的时光荏苒。 畸形的发展状态下,这个世界的游戏游戏产业忠于技术,而忽略内容起来。 大量VR游戏占领市场,却大都以模拟仿真为主! “《都市模拟器》《航海模拟器》《跑酷模拟器》,这都什么东西!” 资深游戏设计师云枫穿越而来,成了濒临破产的游戏工作室经营者。 “而且清一色的买断制游戏,免费游戏它不香吗?!” 觉醒了系统的云枫毅然开启了游戏具现。 《彩虹岛》《地下城勇士》《英雄联盟》《魔兽世界》...... “游戏,可不是只有vr一种!” “买断制游戏,也不该成为穷富人的分界线!” 携无尽经典游戏而来,云枫和一手创办的风云工作室将要搅动游戏界的风云! “您是来做慈善的吧?” 满怀敬畏的眼光中,新的浪潮席卷全球。
我们的太平湖 家国二百年 转生为哈士奇 游荡VR世纪 通玄盗德经 永神纪元 前哨基地 重生异形君王 巫门相医 魔书江湖录 死国1学院篇 男人随心 灵探第七行动小组 结夏蝉声代代鸣 宇宙星河之地平线下 全球穿越:我能吞噬天赋 银河战争之猎户座旋臂 绿茵风云录 黑与白第一季蛮荒之境 为救女儿自制药,攻克绝症 上海携程国旅电话 浠水环通客运站电话 岘港电话卡机场多少钱 中关村医院保健科电话 贵阳必胜客外卖电话 商丘快餐外卖送餐电话 长安栾镇计划生育办电话 广州冶金高级技工学校报名电话 哈尔滨迅达航空招聘电话 昆明海鸥手表售后电话 盖县到沈阳大客电话 盖县到沈阳大客电话 兰博音乐烤吧电话 浠水环通客运站电话 曲阜供热服务电话 连云港颐家温泉前台电话 盐城市各县电话 上海携程国旅电话 昆明到鲁甸汽车票客服电话 陕西杨凌名都商务酒店电话 运德客服电话 陕西杨凌名都商务酒店电话 昆明到鲁甸汽车票客服电话 昆明永都酒店电话 厦门国际机场电话 孝丰足浴电话 上海携程国旅电话 昆明到鲁甸汽车票客服电话 八方达调度室电话 上海携程国旅电话 中关村医院保健科电话 运德客服电话 赤峰馨风雅居物业电话 曲阜供热服务电话 兰博音乐烤吧电话 连云港颐家温泉前台电话 赤峰馨风雅居物业电话 长安栾镇计划生育办电话 兰博音乐烤吧电话 岘港酒店电话 连云港颐家温泉前台电话 广州冶金高级技工学校报名电话 崇阳到赤壁的士电话 盐城市各县电话 昆明火车站客服电话是多少 运德客服电话 盖县到沈阳大客电话 连云港颐家温泉前台电话 孝丰足浴电话 岘港电话卡机场多少钱 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星游戏官网 神医小村民 光灵行传 莽夫的千年暴徒日记 诡异复苏之我真的怕 玄幻:我的宗门亿点强 欧博官网 亚星官网 万利游戏官网 欧博官网 澳门葡京游戏官网 曲阜供热服务电话 运德客服电话 岘港酒店电话 曲阜供热服务电话 曲阜供热服务电话 盖县到沈阳大客电话 昆明到鲁甸汽车票客服电话 淄博上门洗车电话 贵阳必胜客外卖电话 广州冶金高级技工学校报名电话 哈尔滨迅达航空招聘电话 广州冶金高级技工学校报名电话 中关村医院保健科电话 昆明海鸥手表售后电话 兰博音乐烤吧电话 岘港电话卡机场多少钱 孝丰足浴电话 中关村医院保健科电话 淄博上门洗车电话 孝丰足浴电话 厦门国际机场电话 崇阳到赤壁的士电话 陕西杨凌名都商务酒店电话 浠水环通客运站电话 岘港酒店电话 昆明到鲁甸汽车票客服电话 连云港颐家温泉前台电话 昆明到鲁甸汽车票客服电话 岘港电话卡机场多少钱 贵阳必胜客外卖电话