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
平安信用卡领用合约金普信用卡什么意思交通银行信用卡申领条件招商银行信用卡个人卡通用申请表中国邮政储蓄信用卡普卡额度平安信用卡领用合约广发信用卡到期续卡能升级吗交通银行信用卡申领条件为什么买东西不支持信用卡支付麽信用卡存款要手续费信用卡账户欠款事宜委托第三方机构处理交通银行信用卡申领条件信用卡 每月都用满额度信用卡账户欠款事宜委托第三方机构处理民生信用卡超限额度信用卡存款要手续费花呗和信用卡哪个利息高中国邮政储蓄信用卡金卡申请条件中国邮政储蓄信用卡金卡申请条件中国银行信用卡银卡企业法人代表办信用卡中国邮政储蓄信用卡金卡申请条件为什么买东西不支持信用卡支付麽邮政信用卡关联帐户规定招商银行信用卡网络申请表郫县信用卡套现招商银行信用卡网络申请表邮政信用卡关联帐户规定中国银行信用卡银卡信用卡 每月都用满额度 我们都做过梦,儿童到少年,到青年,到壮年,到老年,只是梦的内涵不一样罢了。我且偷偷跟你说,主角这小子不好好学习,天天只知道打游戏,看小说,整些瞎日经,天天都在做梦,你看看他现在又开始做梦了…… 他口出狂言居然想在修真世界拿ak当武器,你说子弹能打败那些逆天的修炼者吗?他异想天开居然妄图在修真世界开采天然气…… 他到底想干什么?说真的我也不知道,预知后事如何还请各位看官一起来看。赵牧意外穿越大秦世界,绑定最强工业系统! 只要完成任务,就可以获得奖励! 叮!完成任务,获得纺织机图纸, 叮!完成任务,获得蒸汽机图纸! 叮!完成任务,获得燧发枪图纸! 赵牧无比激动,终于可以开始工业革命了。 就在他打造了一个地球仪给秦始皇,准备说服他改革军制统一地球的时候,秦始皇拿出了一本九州图志。 北部,元朝和宋朝 东部,大明国 南部,大隋.... “这几个帝国每一个都有天人境强者坐镇!” “就凭你那个打鸟的玩意,也能让朕一统天下?” 赵牧看了看手中的地球仪和燧发枪,陷入了沉思。 禁域,大概是在千年前形成。 无法穿越的迷雾笼罩着,所有的生命在那神秘中只能消逝。 但在各个大陆却又偶尔涌现诡异的传送,通过又活着回来的人都说看见了迷雾的背后,那是奇异的陆地,埋藏着非凡的宝藏。 众神未曾远离,光芒仍然存在。这是一段充满“祝福”的旅程。夕阳不落黑暗永坠。 人族发展前前后后经历了六次黑暗,这第七次黑暗也在这个时候缓缓的来临,所有人都希望能够在这黑暗之中能够存活下来,也正是因为第七黑暗的来临,整个世界也在悄无声息之中发生了翻天覆地的变化,每一次黑暗来临都会孕育出一代强者,而这些强者之中拥有着自己的血脉传承,那些前六次黑暗之中存活下来的血脉传承逐渐的成为了所有人在这第七黑暗存活下来的希望。这是一个称作《灵脉大陆》的神奇世界,这个世界没有魔法,没有武术,没有战斗力,却有着神奇的灵脉。这个世界的每个人在10岁的时候都会在灵脉大殿中,在灵兽师或灵斗士的帮助下进行灵脉觉醒。灵脉可以增强体魄,辅助人们的日常生活。有特殊天赋的人可以通过自身灵脉或召唤灵兽进行修炼并进行战斗,这些人被称为《灵斗士》和《灵兽师》 亡国遗珠沐岚(女主),一步步修炼灵脉,在灵兽(男主)望天君的辅佐下,由凡人之躯修炼成神界监察人界的使者判官,最终铲除了灵脉大陆上的邪恶力量,报了亡国之仇,成为了灵脉大陆上强者。这个世界有纯粹的恶人,也有很多模棱两可的好人,还有一些误入歧途的人,是非善恶有时一念之间,有时由来已久。 这是一个发生在平行世界的故事,在这个平行世界里,有这样一群人。他们在现代社会锄强扶弱,行侠仗义,打击犯罪,被称为现代版侠客。 普通人很少知道他们的存在,被救者对他们感激涕零,犯罪者对他们恨之入骨。他们被称为赏金猎人,而李阳雨就是其中之一。 一声枪响,彻底打破了海天市的宁静。一起持枪杀人案就这样发生了,案发之后,海天市公安局立即展开侦破工作。于是,就开始了一场正义与邪恶的较量。热闹繁华的京城长安发生了一起大案,御史刘文龙被杀,京兆尹崔值奉圣命查案,捕头李成峰和师妹唐婉二人与杀手展开惊心动魄的争斗。最后凶手被诛。二人隐入山中。仙界?呵,你不度他们,那就让我来度你们! 世纪之末, 仙路湮灭,前路断绝,动乱时代,宇宙重开,少年叶天重生于异域,从此踏上仙武大道,悟五行,领阴阳,掌握极致力量。堤岸横空,生灵争渡,不详与诡异肆虐。 少年的背后是血与乱,是生灵的悲歌,少年的探寻的是万灵之希望。彳亍前行,万古寂然,永远在路上。
海贼王之云上漫游 死亡学院:始 都市异能:异人之上! 一几狂潮 仙人众 我用卫生纸拯救世界 我靠读书掌人间 游戏制作:我反向治愈玩家 今朝登天门 CSGO之世界顶峰 绑官记 重活五万年 重生过去成传说 焚神决 重生之甩手掌柜 空间传说之能量风暴 数据代码 不凋花之梦 巫门相医 雾镜夕阳 交通银行信用卡申领条件 招行信用卡取现一千可以分期还吗 郫县信用卡套现 信用卡 每月都用满额度 交通银行信用卡申领条件 招商银行信用卡个人卡通用申请表 郫县信用卡套现 为什么买东西不支持信用卡支付麽 民生信用卡超限额度 企业法人代表办信用卡 邮政信用卡关联帐户规定 邮政信用卡关联帐户规定 中国邮政储蓄信用卡普卡额度 招行信用卡取现一千可以分期还吗 怎么查信用卡里面的钱 信用卡 每月都用满额度 中信银行美国运通白金信用卡 民生信用卡超限额度 成都银行办理信用卡 邮储信用卡存现 招行信用卡取现一千可以分期还吗 信用卡存款要手续费 平安信用卡领用合约 广发信用卡到期续卡能升级吗 手持信用卡额度过高是什么意思 中国邮政储蓄信用卡普卡额度 民生信用卡超限额度 平安信用卡领用合约 成都银行办理信用卡 民生信用卡超限额度 中国邮政储蓄信用卡普卡额度 怎么查信用卡里面的钱 招商银行信用卡个人卡通用申请表 平安信用卡领用合约 邮政信用卡关联帐户规定 中国邮政储蓄信用卡普卡额度 招商银行信用卡个人卡通用申请表 花呗和信用卡哪个利息高 邮政信用卡提高额度 民生信用卡超限额度 招商银行信用卡网络申请表 帮人介绍办信用卡 成都银行办理信用卡 招行信用卡取现一千可以分期还吗 信用卡账户欠款事宜委托第三方机构处理 邮储信用卡存现 手持信用卡额度过高是什么意思 招商银行信用卡网络申请表 邮政信用卡提高额度 广发信用卡到期续卡能升级吗 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 奇志录, 我的世界之旅程 永恒王尊 无敌,从十万分身开始 9527重生之问鼎天下 百度 百度 百度 百度 百度 招商银行信用卡网络申请表 花呗和信用卡哪个利息高 中信银行美国运通白金信用卡 中国银行信用卡银卡 邮政信用卡提高额度 为什么买东西不支持信用卡支付麽 怎么查信用卡里面的钱 招商elle信用卡怎么样 企业法人代表办信用卡 黔南州都匀市信用卡代办 企业法人代表办信用卡 招商银行信用卡个人卡通用申请表 黔南州都匀市信用卡代办 郫县信用卡套现 郫县信用卡套现 招行信用卡取现一千可以分期还吗 信用卡基础知识大全 邮政信用卡提高额度 中国邮政储蓄信用卡金卡申请条件 怎么查信用卡里面的钱 信用卡账户欠款事宜委托第三方机构处理 成都银行办理信用卡 手持信用卡额度过高是什么意思 金普信用卡什么意思 平安信用卡领用合约 民生信用卡超限额度 平安信用卡领用合约 信用卡 每月都用满额度 交通银行信用卡申领条件 招商银行信用卡网络申请表 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网