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
贷款的房子房产复印件丢啦好补么二手房公积金贷款定金如何转账贷款不还中介有过错监狱出来5年能贷款么维仕贷款不还贷款的房子房产复印件丢啦好补么有开发商的大票能贷款吗贷款不还中介有过错贷款损失五级分类办理贷款审核需要卖房人证件么2016年贷款利率计算器贷款不还中介有过错安徽合肥房子抵押贷款2016年贷款利率计算器户口迁移后能在工作地贷款吗办理贷款审核需要卖房人证件么年底贷款好贷吗户口簿能贷款嘛户口簿能贷款嘛复印件能贷款吗济宁的工商银行贷款户口簿能贷款嘛贷款损失五级分类公积金贷款2016新政策身份证贷款如何查询异地购房怎么才能用公积金贷款身份证贷款如何查询公积金贷款2016新政策复印件能贷款吗安徽合肥房子抵押贷款 投胎是门技术活!他竟然,重生在妓馆之中,还是个女的!   虽然,出身卑贱还是女儿身!   为了民族不被女真蒙元荼毒,她要颠倒乾坤,重塑山河人一生总有后悔的事,如果能重来你还会那样选嘛!在一个神秘的大陆,从一个不可知的过去发展至今,大陆上的人类不知何时起掌握了斗争的武器-气脉,从此后整个几乎没有停止下战争,直到一个特殊的王朝诞生,解除了几乎半个大陆的内斗,但王朝的缔造者无法做出完整统一便逝世了。 在这大环境下,男主林真一,从一个小小的村落中诞生,立志成为一位天下第一的大英雄,而随之被一位侠士看中并决定带出了这位少年,还有许多未知和疑惑从此踏上了自己的人生旅程,从踏出这片村庄起,就注定了这位少年不平凡的未来。重生东汉,觉醒菜鸟系统 哪知这个系统与宿主性格不合,下一秒系统直接造反,竟化身成为 最强帝王系统附身他人身上。 誓要与昭昊死磕到底。 从此,昭昊的漫漫三国路变得艰险无比。 为了找出隐藏在背后下黑手的系统,昭昊开启了他漫长的背刺生涯。 凡是有资格成为的帝王的人,都成为了他背刺的目标。 吕布:我此次前往雁门,是为杀了昭昊小儿,以报夺妻之仇。 昭昊:什么,昭昊小儿竟然如此卑鄙,兄长放心,辽与你同去,定斩下昭昊小儿人头以泄兄长心头之恨。 当晚二人把酒言欢,酒后,昭昊将匕首一把刺进吕布的心窝。 昭昊:“兄长,看来你不是系统附身之人。” 董卓祸乱朝纲。 曹操:“董贼不除,我大汉四百年基业岌岌可危,子阳,今晚你我二人就潜入相府,斩杀国贼董卓,还天下一个朗朗乾坤。” 昭昊:“就依孟德之言。” 当晚,二人潜入相府,曹操拿着七星宝刀一步步朝熟睡的董卓逼近,而他的背后,昭昊正手持匕首对准他的心窝。 【元宇宙 爽文 快节奏 老作者 稳定更新】 精灵世界即将以游戏的形式降临世界,震惊全球! 而在游戏上线的一周前,顶级玩家云晓重生归来,通过系统获得提前登录游戏的资格! 前世的遗憾、遭遇的背叛...他都将在这一世全部改写! 在一个异世界中存在着很多国家,在这众多国家中有些国家正密谋着一场大事。短篇小说曾浩重生到北宋水浒世界,竟成为武大郎! 还好,此刻的潘金莲还是单纯小可爱,西门庆还没有出现。 他誓要改变武大郎悲惨的命运! 收服各路梁山好汉,利用梁山好汉们独特的本领不断扩大自己的势力。 与神医安道全发展医药业; 与林冲、索超、呼延灼等好汉发展物流运输与边境贸易; 与浪子燕青、铁叫子乐和发展娱乐业…… 一人,一妻,一国。诏安的惨剧将不会重演! 曾浩要让所有看不起武大郎的人都知道,什么叫降维打击!重生在和精灵互通的世界,杨凡成为了一名即将继承道馆的道馆主。 可因为初始精灵是一只极其弱小胆怯的拉鲁拉斯,眼看道馆审核在即,要被扫地出门。 在这千钧一发之际,获得精灵养成系统。 “你的拉鲁拉斯因为自责太过弱小,决定黑化变异,主动进化为奇鲁莉安!” “你的长耳兔要和你一起跳广场舞很开心,将珍藏的mega石送给了你!“ “你的美纳斯因为和你一起泡澡,触发技能buff,所有水系技能威力增加30%!“ 赤:我唯一没有打过的就是杨凡的道馆! 蓝:凡哥哥的精灵都好喜欢他啊,真羡慕! 没过多久,众人纷纷发现,昔日的残破道馆不知什么时候,已经屹立于两个世界的顶点,甚至不时还有神兽的踪迹隐没在道馆内……何为末世?丧尸?魔怪?虫族?不!唯有当人类所恐惧的,所崇拜的,甚至是所幻想的一切都成为现实之时,才是人类真正的末日!灵气回涌,信仰重铸,这是神佛妖魔的饕餮盛宴,也是人类有史以来的最大浩劫!丧尸,异形,贞子,怪形,妖精鬼怪,神魔仙佛,这一切的一切,都将降临于世!这是真正的末日,这是末世……神魔纪元!——————这是不冷的第四本书,已完本三本共1500W字小说,无太监,人品保证,新书期急求支持!加更规则:打赏满100加更一章,鲜花满1000加更一章,加更的章节会在上架后爆发!
四合院:满院禽兽都死远点,滚 梦里的你再强大也是真的 做民宿的那几年 重回1992 神话入侵:从模拟器开始斩神 我做鬼的那些年 我在异界守城池 鬼帝之重启异世 恶龙英者 玄天灵阁 诸界求生 寰宇道帝 神兽召唤师 异界之我的科技帝国 封澜传 绝世阎罗 神兵之巅 四灵战纪 我的幻梦之旅 超级无敌之男神 助学贷款学生证一般复印哪面 契税与公积金贷款 户口迁移后能在工作地贷款吗 郴州公积金贷款需要证信吗 装修房子怎样贷款 车贷可以贷款5年 户口迁移后能在工作地贷款吗 贷款流水帐可以让家人打钱吗 办理贷款审核需要卖房人证件么 复印件能贷款吗 身份证贷款如何查询 身份证贷款如何查询 成都农商银行小额贷款 契税与公积金贷款 年底贷款好贷吗 济宁的工商银行贷款 监狱出来5年能贷款么 助学贷款学生证一般复印哪面 郴州公积金贷款需要证信吗 贷款不还中介有过错 助学贷款学生证一般复印哪面 户口迁移后能在工作地贷款吗 二手房公积金贷款定金如何转账 2016年贷款利率计算器 办理贷款审核需要卖房人证件么 贷款流水帐可以让家人打钱吗 异地购房怎么才能用公积金贷款 二手房公积金贷款定金如何转账 郴州公积金贷款需要证信吗 异地购房怎么才能用公积金贷款 维仕贷款不还 装修房子怎样贷款 监狱出来5年能贷款么 贷款的房子房产复印件丢啦好补么 公积金贷款2016新政策 维仕贷款不还 监狱出来5年能贷款么 年底贷款好贷吗 贷款流水帐可以让家人打钱吗 户口迁移后能在工作地贷款吗 身份证贷款如何查询 成都农商银行小额贷款 没钱结婚可以贷款吗 南京房地产项目贷款 2016年贷款利率计算器 助学贷款学生证一般复印哪面 那种贷款买车快 身份证贷款如何查询 贷款流水帐可以让家人打钱吗 有开发商的大票能贷款吗 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 神域彼岸 偏执大佬不好惹 网游之我能无限召唤英雄 玄幻:我能看见机缘线 高田寨传纪 百家乐官网 澳门葡京官网 葡京官网 百家乐官网 万利游戏官网 户口簿能贷款嘛 二手房公积金贷款定金如何转账 二手房公积金贷款定金如何转账 南京房地产项目贷款 那种贷款买车快 安徽合肥房子抵押贷款 有开发商的大票能贷款吗 车贷可以贷款5年 郴州公积金贷款需要证信吗 公积金贷款2016新政策 2016年贷款利率计算器 安徽合肥房子抵押贷款 户口迁移后能在工作地贷款吗 助学贷款学生证一般复印哪面 没钱结婚可以贷款吗 抵押贷款 安徽 银行 户口簿能贷款嘛 二手房公积金贷款定金如何转账 二手房公积金贷款定金如何转账 装修房子怎样贷款 助学贷款学生证一般复印哪面 身份证贷款如何查询 抵押贷款 安徽 银行 办理贷款审核需要卖房人证件么 济宁的工商银行贷款 南京房地产项目贷款 户口簿能贷款嘛 成都农商银行小额贷款 异地购房怎么才能用公积金贷款 装修房子怎样贷款