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
平安银行网络贷款女生做贷款销售怎么样平安银行新一贷 第二次贷款浦发的贷款期限最短是企业贷款不还股东责任吗平安惠普贷款汇率汽车贷款月利息平安银行新一贷 第二次贷款农业银行网上贷款3万汽车3年无利息贷款企业如何在银行贷款平安银行网络贷款汽车贷款没有利息怎么算企业光伏贷款申请书平安银行新一贷 第二次贷款汽车3年无利息贷款农商银行创业贷款条件企业贷款容易吗企业贷款容易吗平安贷款渠道都有什么区别女儿贷款父母会影响吗企业贷款容易吗农业银行网上贷款3万平安贷款广告企业贷款不还股东责任吗朋友用房产证帮我贷款吗浦发的贷款期限最短是骗取贷款罪的区别平安贷款可以逾期多久汽车贷款没有利息怎么算我叫郭宁,来自郭家村的小伙,意外发现郭文前辈留下的,修炼心法,从此踏上修炼之路,平平凡凡过了十几年,今天终于迎来破境筑基化仙,刚突破完突然一个陌生的大叔出现在我面前,是友是敌?一场不知是何原因导致的末日灾难,将李恒奇传送到一个他完全不了解的宇宙世界——地球。这里的人与他的身体构造相同,只是文化却大有差异,科技水平也十分落后。于是漫漫回家路,他利用残存记忆和先进的科技在这里定居下来,本性善良的他在不毁灭这个世界的前提下,试图探索宇宙奥秘。只是这一切并没有那么顺利,万事不仅开头难,还有过程难,更有成功难! 他有一个看似玩具一般的设备——造梦陀螺,能够让人美梦成真,宛如在现实中一般。可是这仅仅是一个玩具吗?穿越到了大秦。 成了大秦的十九公子赵祁。 从小装疯卖傻,成了人人唾弃的废物。 此时正值大秦历三十七年,嬴政为寻长生,不顾百官阻挠,执意东巡访仙。 “父皇,你老了。” 就在此时,最不成器的十九公子赵祁提剑入咸阳宫。 【叮!】 【签到地点:咸阳宫】 【签到任务:逼迫始皇退位】 【签到奖励:一万大雪龙骑军】 面对一千始皇禁卫军。 赵祁有三千黑水台铁鹰卫效忠, 面对两万的黑甲禁军。 赵祁召唤出一万大雪龙骑军将其杀得抱头鼠窜。 这一日。 咸阳宫上。 蛰伏了足足十八年的赵祁第一次穿上黑水龙袍。 站立在龙椅之前。 高举手中雕龙长剑。 朗声道: “儿臣赵祁,恳请父皇退位!”这是一个内卷的修仙世界,龙太子螭吻却不能选择躺平。 他拥有天界最强的修炼天赋和最强的肉身躯体,却苦修十年,一直提升不了境界。 他修炼了十年,就被天界的正统修道士给耻笑了十年。 “天界修道吊底儿”的帽子,他整整戴了十年,他也足足隐忍了十年。 直到十八岁生日的那天,他终于等来了一次机会,一次下界封兽的任务。 天界赐给了他《封兽榜》,一个能吸取妖气的法宝。 但是,他好像是一个妖修... 于是,新一代妖族之主螭吻的都市修仙升级故事,就此开始。异能者的觉醒,使人类面临着悬崖上的抉择。 强权与堕落,腐朽与血腥,谁来拯救混乱中的大陆? 一枚少年。 一个系统。 一句真言。 一场浩大的华夏劫难席卷了整个四分五裂的南北大地。 一位英明的皇帝从小在恩师的教导下。 成为了帝王挽救了这一场南北分裂的局面。 无尽大陆拳之斩道者,于无上之地被出生入死五位战友陷害。 重生后的他,携带无尽大陆天空之城至宝再活一世。 这一世!六合八荒拳所开之处无一人争锋。 我辈拳法可以弱,争胜之势可以输,唯独这一身拳意绝不可退! 唯有不断的挥拳,才可变的更强!天下大乱,赵公云和楚国连手,所向披靡。穿越平行世界,参加选秀综艺,商献毫无意外成为偶像。 粉丝:明明可以靠脸吃饭,却偏偏靠才华,他重新定义了偶像! 商献:我不想做偶像啦,抄歌没有一点挑战性,想尝试去演戏! “人太帅,演什么都画风突兀,还是专心唱歌吧!” “这垃圾演技,安心当个偶像吧,演戏不适合你!” “演的什么鬼!差评!发首新歌我们才能原谅你!” ———— 多年后,当商献入选《时代周刊》年度风云人物,人们才恍然惊觉,这个偶像并不简单…… 年度风云人物评语:他创造了一个时代,在各种意义上!当一个疯子觉醒了史上最强的职业,这个世界会发生什么事情呢。
有风自南落长安 大夏执刀人. 复定天地 精神病院日记 诸天万界:从射雕开始 极品鉴宝狂婿 我的怪谈爱好者协会 巅峰之武道无双 终末的生存实录 创世天傲 路人系统之命运重生 铸神策 修罗刺 咒术战戒 大国上医 九段妖孽慕薄渊 系统穿越之咸鱼翻身 龙帝重生都市 菩提道祖 绝世强龙 朋友贷款如何签订协议书 企业网银怎么申请贷款 农商银行创业贷款条件 企业贷款容易吗 朋友贷款如何签订协议书 批完贷款何时放款 你我贷贷款利息高吗? 汽车贷款10万利息多少合适 朋友用房产证帮我贷款吗 汽车贷款没有利息怎么算 农业银行网上贷款3万 农业银行分期贷款利率 平安贷款广告 汽车3年无利息贷款 平安惠普贷款汇率 企业贷款不还股东责任吗 你我贷贷款利息高吗? 朋友用房产证帮我贷款吗 女儿贷款父母会影响吗 平安银行网络贷款 企业网银怎么申请贷款 平安银行新一贷 第二次贷款 女生做贷款销售怎么样 企业光伏贷款申请书 汽车3年无利息贷款 平安贷款广告 朋友用房产证帮我贷款吗 女生做贷款销售怎么样 女儿贷款父母会影响吗 朋友用房产证帮我贷款吗 企业贷款不还股东责任吗 企业网银怎么申请贷款 浦发的贷款期限最短 平安银行网络贷款 骗取贷款罪的区别 企业贷款不还股东责任吗 浦发的贷款期限最短 你我贷贷款利息高吗? 平安贷款广告 浦发的贷款期限最短 企业贷款不还股东责任吗 汽车贷款20万利息多少 平安贷款渠道都有什么区别 农业银行分期贷款利率 企业光伏贷款申请书 企业网银怎么申请贷款 农业银行网上贷款3万 浦发的贷款期限最短是 平安贷款可以逾期多久 汽车贷款月利息 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 老子是高手之彩票沉迷 听从我的召唤英灵 真的要逼我认真吗 长恨歌谈 修真身份被曝光了 亚星游戏官网 万利游戏官网 欧博游戏官网 亚星游戏官网 葡京官网 汽车贷款月利息 汽车贷款没有利息怎么算 企业贷款容易吗 朋友用房产证帮我贷款吗 平安贷款可以逾期多久 企业贷款容易吗 企业如何在银行贷款 企业贷款容易吗 农业银行公司抵押贷款 企业光伏贷款申请书 汽车贷款10万利息多少合适 农业银行分期贷款利率 浦发的贷款期限最短 平安银行网络贷款 汽车贷款没有利息怎么算 女生做贷款销售怎么样 批完贷款何时放款 朋友用房产证帮我贷款吗 农商银行创业贷款条件 浦发的贷款期限最短是 企业如何在银行贷款 批完贷款何时放款 农业银行分期贷款利率 农商银行创业贷款条件 平安惠普贷款汇率 农业银行分期贷款利率 女儿贷款父母会影响吗 平安贷款可以逾期多久 女儿贷款父母会影响吗 汽车贷款10万利息多少合适