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
2009年+性爱主题电影东京中国电影周2015电影火星救援影评免费赌徒电影电影赌徒讲的是什么2009年+性爱主题电影中国大陆同志电影电影火星救援影评电影+现实两周 电影同性电影国语版2009年+性爱主题电影电影大杂烩一级男同性恋电影名45周年 电影 下载四月三周两天 电影本周动画片电影电影大杂烩电影大杂烩电影赌徒讲的是什么将上映的电影电影大杂烩直冲好莱坞电影在线九妖塔电影电影两周2009年+性爱主题电影电影两周九妖塔电影电影赌徒讲的是什么每周电影排行榜陈彬为了完成父母夙愿,考入警校的刑侦专业。 可进入警局实习的前一天晚开始噩梦。 即将发生的凶案细节,全部都会清晰显现于梦中。 跟踪案件,抽丝剥茧,层层拨开,最后竟是一个巨大的阴谋。天道有缺,世间最强体质神魔霸体被天道所摒弃,十五年忍辱,终将迎来曙光! 大道枷锁自束己身桎梏又如何?我自当逆战苍穹,笑傲九重天,神挡杀神,佛挡弑佛,逍遥天地间! 一日破关,我为尊,一拳荡寰宇,一脚山河溃,一静万物生,一动诸天陨,一念可化阴阳轮回,一念可镇压永恒万古! 我为太古第一神王,天骄至尊皆是我帝路上尸山血海! 我当以一双铁拳,粉碎诸天万界,天道也不行!在这个世界。 各种诡异生物和幽影,随时都能将生命轻松剥夺。 人们都活在惶惶不安中,提起精神保住小命。 唯恐陷入阴影,消失在世界上。 “这个世界没救了。” “没人能扭转这个世界死亡的结局。” “除了我。” “系统,给我抽!” 「你这外乡人既然觉得关内的人心太复杂,当初你又为什么会从关外进来呢?」 面对这个问题,谢佳晨只是回答:"我只想找到回家的路,没想到事情会发展成这样子。" 「我看你是找死!」 夜良游漫不经心地回应,连夜府独门身法「瞬息闪」都看不明白的人,恐怕被别人杀了都不知道对方是谁,这样的人在烈州还能修炼到化龙境巅峰,真是奇迹了。 「人世间的事情是很难预料的,再加上每个人不同的强烈欲望,从而形成这江湖上的格局。」 「朝堂,分为两派,一派主战一派主降,在统治者的视角看来,主战的怂恿之人该杀,主降的苟且偷生之人该死。」 「宗门,是培养人才的地方,处于最弱方,仅靠着门下那几颗璀璨的新星得以正常存在下去。」 「天行健,君子以厚德载物。」 「集打工人、房奴、社畜于一体的小谢因为一场车祸,导致灵魂被撞飞到了异界龙魂大陆,在这个集宗门、江湖、庙堂于一体的世界中,倒霉的他该如何生存?被黑白两道追赶地走投无路,黑化后的他又是如何的恐怖?」人生一世,俯仰之间,若草木一秋,忽然而已。谁说经商耽误修炼,凭借商道,他便纳尽天下之物;谁说奕棋消弥意志,凭借奕道,他得了部上古奇书。 以此两道,最终成就了他的神行之路。他凭此一路披荆斩棘,高歌猛进,开启了铁血征战、跌宕起伏的人生之旅。 为聚天下财,他创立扬天商盟;为报血海仇,他鏖战惊天世家;为解万古迷,他踏遍九州天下;为登通天路,他摘尽日月星辰。 越开元,破灵台,入天元,成金丹,踏神境,戮上仙,终得天道。什么仙、神,都将匍匐在他的脚下…….第一次写,如果质量差的话可以提意见,不喜勿喷,谢谢大家ovo远古人类探索,揭秘古老遥远的史前世界!孔铮能够在英雄本色香江世界和蓝星之间穿越,嘴贱惹祸,被逼进了娱乐圈,他是小商人、是莽汉、是侠骨柔情、是钢铁直男......一个无知小人物逆袭的故事。 也不知从什么时候开始,男人的责任和压力小了。继而,出现了所谓的“X子男”,颠覆了现实生活,让人万万没想到......
留住青春一回眸 白冷川修仙传 幸存者的獠牙 入了魔道,然后嫁给哥哥 大话西游之如来密码 和校花妹妹同居的日子 让你表演惊悚片,怎么全成真的了? 凡胎异能之纵横四海 老子不是教父 少年吸血鬼与女勇者 哥,你真霸道! 帝释缘空 小七的神奇一生 普泽林大陆 系统之上下五千年 我夺舍了魔道祖师爷 回到过去当盖亚 溪鱼草记 我在城南以西,等你 都市修仙:怕鬼狂少登仙录 电影+现实 电影赌徒讲的是什么 惊变28周 电影天堂 2009年+性爱主题电影 电影+现实 成龙电影大全在线观看 电影大杂烩 一级男同性恋电影名 每周电影排行榜 45周年 电影 下载 中国大陆同志电影 电影票半价都在十点买的吗 本周动画片电影 直冲好莱坞电影在线 柏青电影农村 成龙电影大全在线观看 九妖塔电影 两周 电影 一级男同性恋电影名 四月三周两天 电影 三明市电影院 电影+人与神 同性电影国语版 本周动画片电影 直冲好莱坞电影在线 电影大杂烩 两周 电影 同性电影国语版 一级男同性恋电影名 两周 电影 成龙电影大全在线观看 三明市电影院 每周电影排行榜 四月三周两天 电影 惊变28周 电影天堂 成龙电影大全在线观看 电影+现实 四月三周两天 电影 将上映的电影 九妖塔电影 电影赌徒讲的是什么 惊变28周 电影天堂 六宅一生电影 电影+人与神 一级男同性恋电影名 45周年 电影 下载 电影+现实 免费赌徒电影 paddington电影英文简介 中国大陆同志电影 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 苍银骑士与魔女传说之夜 玄幻:我的灵气能化万物 仙凡古道 人一辈子,哪有如果 桃源盖世小仙医 欧博官网 亚星官网 澳门葡京官网 百家乐官网 皇冠登3出租 电影两周 电影+人与神 同性电影国语版 危情黑吃黑电影 电影生什么五个字 电影大全道士出山 东京中国电影周2015 四月三周两天 电影 电影火星救援影评 将上映的电影 六宅一生电影 三明市电影院 电影赌徒讲的是什么 两周 电影 成龙电影大全在线观看 电影两周 电影大全道士出山 一级男同性恋电影名 将上映的电影 电影大杂烩 免费赌徒电影 每周电影排行榜 免费赌徒电影 每周电影排行榜 成龙电影大全在线观看 四月三周两天 电影 直冲好莱坞电影在线 东京中国电影周2015 电影火星救援影评 电影票半价都在十点买的吗