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
农村信用卡绑定支付宝民生办了两张信用卡额度农村信用卡绑定支付宝吗农村信用卡交易密码吗农商行易贷卡和信用卡农村信用卡绑定支付宝宁波浦发信用卡中心电话号码农村信用卡绑定支付宝吗民生in卡信用卡开卡礼宁波广发银行信用卡积分兑换农信信用卡提额短信提醒农村信用卡绑定支付宝宁波浦发信用卡中心农信信用卡提额短信提醒农村信用卡绑定支付宝吗宁波广发银行信用卡积分兑换农村信用卡交易密码是什么农信信用卡还款宽限日农信信用卡还款宽限日宁波银信用卡中心民生办了两张信用卡农信信用卡提额短信宁波浦发信用卡中心官网农行的房贷办信用卡额度是多少时间农商行易贷卡和信用卡民生办信用卡领礼品农村信用卡交易密码吗农行的房贷办信用卡额度是多少钱啊宁波银信用卡中心宁波浦发信用卡中心夏历2222年,黑色的太阳突然从极渊升起,在天穹之上悬挂七日,全球陷入一片黑暗。 此次事件中,整条赤道全线崩坏,水蓝星裂开一道长达4万公里的影渊,横贯东西。 七天后,黑日退去,光明重洒大地。 可当人们欢呼灾难结束之时,却不知无尽的恐怖正从影渊之中醒来。 自此,全球复苏,百鬼夜行。 一代帝师,遭遇自己十位爱徒的背叛,复苏后彻底迈上魔道之路…… 刀劈帝宫镇四方,掌灭星辰踏踏苍穹,诸天万道群雄起,看尽英豪我为尊! 皇七夕出生于七月初七,儿时体弱多病,家道中落,受尽欺凌。终激活仙脉,能文能武,文,读书过目不忘,先知先觉后3年人间事,武,太极八卦拳,练成独门神打绝技,且看他,学业和事业上一路高歌,不为官,只为商,终成一方商业霸主,江山如画。陈今误入异世江湖,竟身不由己成为了武林公敌,神秘玉佩隐藏的秘密是引发这场江湖纷争的诱饵,而到底谁才是那个幕后布局之人......急急急,修为高深的仙子要杀我,怎么破局?! “系统已切换成攻略版本,助宿主攻略成功。” 急急急,收不到天姿绝顶的弟子怎么破?! “系统已切换成最强师徒养成版本,为您保驾护航,助宿主登顶最强。” 李言在某个夜晚入睡时发现自己进入到了一个未知的世界,在这里,他将开始自己的冒险天道气运加身,神仙妖魔能奈我何? 绝世功法,上古神兵,圣地神女 通通都是我的 推我入深渊的人,我将亲手送你下地狱, 看不起我的人,我终将成为你们的神! 妖魔并起,人族大秦风雨飘摇。 林枫穿越成为大秦书生,觉醒神级读书系统,只要读书就可以提取神通,获得才气值抽奖。 “叮,宿主翻阅《天龙八部》,提取神通下笔如有神!” “叮,宿主进行紫级奖池抽奖,抽到圣级修为!” …… 大秦生死存亡之际,一位青衫书生横空出世,吟唱成剑,风采绝世,无数神通尽出,百万妖魔飞灰湮灭!一身白衣少年郎,当为天下第一狂! 屠魔的少年终将成魔! 悠悠岁月,漫漫长夜。 以神入境,以形破界。修仙长道,有你无我。 这是属于每个人的时代,人人皆可修仙。《血染的风采燕然勒功》一书为中国共产党诞辰百年献礼作品,本书改编自拙作《复仇利剑》。大学毕业生战智湛参加了“利剑”侦察分队,刚到南疆即遭越军“影子部队”暗算。“围点打援”一计不成,“影子部队”又偷袭“利剑”分队的营地,一次偷袭不成又再度偷袭。为夺取战略主动,“利剑”侦察分队跨境作战,打残了“影子部队”。战智湛怒歼围困战友的越军连队,突袭越军机场,在战友们默契的配合下活捉潜逃的叛徒、内奸、越军间谍“金莲花”。越军陆军司令部和情报总局之间的勾心斗角使得战智湛虽然几度与“影子部队”斗智斗勇,但却能死里逃生。战智湛的战友击毙了“影子部队”分队长冯氏德英,“影子部队”残部也被“前指”调到边境,被我炮兵部队聚歼。战智湛在战友们的接应下,返回祖国。
都市之我被迫成神 流浪在仙界 我有一只大章鱼 吾剑永恒 都市最强高富帅 超能序列:枪弹传奇 我是一把剑 末日成就,从精神病院开始 都市古武仙医 天心策 都市猎仙人 我必吞天 朝阳少来 大道之无恨 天元真仙 四具棺材 超级逆袭赘婿 七月之火 诸神将临:我有斩神模拟器 不是一般的校园修仙 民生办了两张信用卡额度吗 宁波广发银行信用卡积分兑换 农村信用卡交易密码是什么 农信信用卡还款宽限日 民生办了两张信用卡额度吗 民生标准信用卡卡免费 农村信用卡交易密码是什么样的 宁波广发银行信用卡积分兑换商城 民生办信用卡领礼品 宁波浦发信用卡中心 宁波浦发信用卡中心官网 宁波浦发信用卡中心官网 农行的房贷办信用卡额度是多少时间 宁波广发银行信用卡积分兑换 宁波银信用卡中心地址 农商行易贷卡和信用卡 农村信用卡交易密码是什么意思 民生办信用卡领礼品 民生办了两张信用卡 农村信用卡绑定支付宝 您的招行信用卡已核发 农村信用卡绑定支付宝吗 民生办了两张信用卡额度 农信信用卡提额短信 宁波广发银行信用卡积分兑换商城 农行的房贷办信用卡额度是多少时间 民生办信用卡领礼品 民生办了两张信用卡额度 民生办了两张信用卡 民生办信用卡领礼品 农信信用卡还款宽限日 您的招行信用卡已核发 农村信用卡交易密码吗 农村信用卡绑定支付宝 农行的房贷办信用卡额度是多少时间 农商行易贷卡和信用卡 农村信用卡交易密码 农村信用卡交易密码是什么样的 农行的房贷办信用卡额度是多少时间 农村信用卡交易密码 农商行易贷卡和信用卡 能坐车的信用卡 宁波银信用卡中心 农村信用卡交易密码是什么意思 农信信用卡提额短信提醒 您的招行信用卡已核发 宁波浦发信用卡中心官网 农商行易贷卡和信用卡 农行的金卡如何办理信用卡 宁波浦发信用卡中心电话号码 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 异界之鬼手 吾本凡胎 本宫要修仙 震惊!我的金手指神明都慕了! 神界天花板 欧博官网 亚星管理平台 澳门葡京游戏官网 欧博官网 亚星游戏官网 宁波浦发信用卡中心电话 民生办了两张信用卡额度 农村信用卡交易密码是什么 宁波浦发信用卡中心电话 农行的房贷办信用卡额度是多少时间 宁波浦发信用卡中心电话号码 农村信用卡交易密码是什么意思 农行的房贷办信用卡额度是多少钱啊 宁波浦发信用卡中心官网 农信信用卡提额短信提醒 民生办了两张信用卡 农信信用卡提额短信提醒 农村信用卡绑定支付宝吗 您的招行信用卡已核发 民生办了两张信用卡额度吗 能坐车的信用卡 民生办信用卡领礼品 农村信用卡绑定支付宝吗 农行的房贷办信用卡额度是多少钱啊 民生办信用卡领礼品 农信信用卡提额短信 民生标准信用卡卡免费 宁波银信用卡中心 农信信用卡还款宽限日 宁波银信用卡中心 农村信用卡交易密码是什么意思 农村信用卡绑定支付宝 农村信用卡交易密码是什么意思 宁波浦发信用卡中心 宁波浦发信用卡中心官网