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
住房公积金贷款 划算助学贷款利息结算住房抵押贷款利息测算住房贷款需要抵押吗住房贷款 改变 时间住房公积金贷款 划算助学贷款好申请成功不住房抵押贷款利息测算助学贷款金额是几年的助学贷款丢了怎么补办助学贷款登录密码几位?住房抵押贷款利息测算助学贷款给的银行卡号吗珠海无抵押贷款公司住房贷款与抵押贷款助学贷款丢了怎么补办助学贷款还贷时间点珠海银行贷款利率上调珠海银行贷款利率上调住房公积金可以贷款买车么助学贷款可以办多年珠海银行贷款利率上调助学贷款金额是几年的株洲河西汽车贷款住房贷款 改变 时间助学贷款没续贷住房贷款想提前还款株洲河西汽车贷款住房公积金可以贷款买车么助学贷款给的银行卡号吗妖,天地之妖,鬼,天地之鬼,人,天地之人。 少年偶然得到戒指,看他如何在这复杂的地方拯救众人入狱五年,再回都市。 叶昭只得感叹世事无常。 前脚遭受前女友背叛,后脚江氏大小姐主动追求。 大小姐的脾气不好怎么办?爷乐意,宠着! 兄弟们喜欢搞事情怎么办?爷惯得,忍着! 左手悬壶救世,右手银针杀人,左右逢源,天下无双!异世界重生 一穷二白, 苏醒后只有个关心自己的漂亮妹妹。 罗修在一场梦中获得了一枚神奇的戒指,戒指中藏着一个魔,噬魂者,自此以后,罗修得噬魂者的帮助,连同雷羽川,和绿色幽灵等各种邪恶的组织进行了一连串的较量知识就是财富。想看看老知识分子是怎么发财的吗? 这是一本能给你带来阅读愉悦感的书,一本能让你精神世界更丰富的书,一本能让你在轻松和快乐中增长知识与见识的书,一本脑洞大开的书。 如果拥有别人没有的知识也是一种异能的话,这应该是一篇社会异能小说。宋卫星在机缘巧合下一步一步走向人生的成功之巅。 善良是他的盔甲,知识是他的武器;脑洞大开的情节,不落俗套的故事,缜密的逻辑,真实的细节,虚构的小说,一篇用人物和故事写成的科学论文。 这时一个奇幻的咒术世界,每个人从出身起,身上都带有咒能,如果掌握娴熟,就可以发挥出巨大的力量。根据每个咒术师的不同,咒术界将咒能换做六种专业,分别是“近战系”“远程系”“魔药系”“时空系”“暗耀咒术系”“光辉咒术系”,近战.和远程系都是将咒术转化为武器对敌人造成伤害,而魔药系和时空系是属于辅佐类的专业,暗耀咒术系和光辉咒术系都是强大的攻击单位,但两个专业加入的条件都十分的苛刻,几乎没有诞生过几位优秀的咒术师。而学习这些专业都有专门的学校教学,其中这本书的故事发生在黔斯徳黎学院,处于亚欧大陆与美洲大陆中央的传送口。 学院西边有一条奇怪的小溪,上边着着熊熊大火,下边却冻着严严实实。 东边有一处远古森林,世界上各种奇珍异兽都在这儿生活。这里还生活着一个村落——“徳黎村”主角柳旭豪就生活在着,除此之外,还有好多的奇幻的事物都在书中,等待探索—— 一个宅男穿越到日本战国时代,逢凶化险,不断适应成长的历险故事。心海飘,心海摇,谁人知晓天地高。独撑孤舟荡青黄,见姜尚,慰寂寥,不知清梦何人扰。翩翩离梦虚若实,再回首,却是虚无缥缈,虚无缥缈……夏魄爆肝一款修仙游戏十五年,通关之时却意外来到游戏的世界,成为了一个家族的杂役。 还好这游戏把通关奖励送给了他,让他得到了长生不死的能力。 在这里付出了十五年青春的他深知这个人心叵测,妖魔横行的世界很危险,于是决定苟起来修炼个几千年再说。 时光流逝的飞快,在熬死了无数强敌之后,他发现自己已经无敌了。高二的时候学校校花莫名其妙的说我是她对象,害的我被学校大哥给盯上了…… 有一种孤独是,心心念念着一个人,却没有她的联系方式,如果最后是你啊,晚一点没关系。我叫路森尧,我的故事 从高二开始。
至尊镇万古 腥红轮回 轮回系统之异界战神 白山黑水之天狼传奇 铭道录 顾梦一场 澪囬燚:知雨梦幻 太古第一神王 荒漠幸存 狐,媚月 来自东方的21世纪神 至尊神医纵横都市 修仙需要靠创业 我只出一剑 包子迷你世界 血溅龙渊 我的网文日记 校园第三部曲 幸 异世的希望 渡尘,登仙 助学贷款金额是几年的 住房贷款 改变 时间 助学贷款给的银行卡 住房贷款与抵押贷款 助学贷款金额是几年的 助学贷款可以办几年 助学贷款给的银行卡号吗 珠海无抵押贷款公司 助学贷款没续贷 助学贷款给的银行卡 助学贷款金额是几年的 助学贷款金额和年限 舟山公积贷款号码 助学贷款第二年还款 住房公积金贷款 划算 住房贷款 改变 时间 助学贷款几次 助学贷款没续贷 助学贷款可以办几年 住房抵押贷款利息测算 助学贷款第二年还款 住房贷款与抵押贷款 助学贷款利息结算 珠海无抵押贷款公司 助学贷款丢了怎么补办 舟山公积贷款号码 助学贷款没续贷 助学贷款利息结算 助学贷款可以办几年 助学贷款没续贷 住房贷款 改变 时间 助学贷款登录密码几位? 住房贷款需要抵押吗 住房公积金贷款 划算 株洲河西汽车贷款 住房贷款 改变 时间 住房贷款需要抵押吗 助学贷款还贷时间点 舟山公积贷款号码 住房贷款与抵押贷款 住房贷款想提前还款 助学贷款给的银行卡 住房公积金交多少可以贷款 助学贷款几次 珠海无抵押贷款公司 助学贷款第二年还款 助学贷款金额和年限 住房贷款想提前还款 舟山公积贷款号码 助学贷款好申请成功不 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 仙道圣尊 黑魔法使 满级肉身:我能扛最毒的打 复仇少年的逆天赞歌 都市之一代狂神 欧博官网 亚星游戏官网 亚星官网 欧博官网 澳门葡京游戏官网 助学贷款给的银行卡号吗 助学贷款个人征信 助学贷款没续贷 助学贷款给的银行卡 助学贷款好申请成功不 助学贷款没通过 助学贷款还贷时间点 助学贷款给的银行卡号吗 助学贷款金额和年限 住房贷款 改变 时间 住房公积金交多少可以贷款 珠海银行贷款利率上调 助学贷款可以办多年 助学贷款几次 助学贷款可以办几年 住房公积金交多少可以贷款 助学贷款没通过 助学贷款可以办几年 助学贷款给的银行卡 助学贷款利息结算 珠海拱北贷款 住房贷款需要抵押吗 株洲河西汽车贷款 助学贷款没通过 住房公积金可以贷款买车么 助学贷款好申请成功不 助学贷款几次 助学贷款还贷时间点 住房抵押贷款利息测算 舟山公积贷款号码