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
楚乔传全集的电视剧电视剧大刀记57集东游记电视剧土豆视频8马天宇和mike演的电视剧湄公河大案电视剧莫雄楚乔传全集的电视剧马局是什么电视剧东游记电视剧土豆视频8林河政法委书记电视剧色戒电视剧介绍电视剧 火了的词楚乔传全集的电视剧林宇中的电视剧原点电视剧爱情开头的名字大全集东游记电视剧土豆视频8色戒电视剧介绍冒牌英雄电视剧28集电视剧(璇流电视剧(璇流电视剧隐爱结局是什么意思电视剧不收费网站电视剧(璇流林河政法委书记电视剧梦圆何方电视剧下载湄公河大案电视剧莫雄电视剧里有个叫乔生马天宇和mike演的电视剧tfphone演过什么电视剧电视剧母爱如山39集林宇中的电视剧原点我有一剑,镇压诸天,我有一剑,可斩诸天神佛。 往来荣辱争天功,泪洗美人,血战英雄;龙麟少主,开一扇门庭,演一段真空,管哪天高情无容?心在蓬莱,岿然不动。 ‘玄之又玄,众妙之门’。龙麟人王昭之开建匡正之门,能致虚极,亦能守静笃,从而与少年英雄们引起了新时代的大变革。股神林辰重生,为了看清人心,他放出破产假消息,结果让他心寒,不过却收获真正的友情,亲情和爱情…… 九州大陆,万国争霸! 穿越大秦,成为公子赢昊! 开局发配凉州,遭遇匈奴劫杀,觉醒无双大帝系统! 签到千人战场,获得七星战将华雄效忠! 签到万人战场,获得八星上将赵云效忠! 签到十万战场,获得九星大将吕布效忠! 签到百万战场,获得十星神将项羽效忠! …… 且看公子赢昊,如何征战天下,成就无双大帝! 天塌下来由高个子顶着,梦飞扬成了那个高个子,在别人羡慕的眼神中,梦飞扬心理却很苦恼。 遥望星空,那是破碎的星辰,目光看向下方满是破碎山河大地。天命之年也能穿越?早就被生活磨平棱角的主角重回40年前,乘着改革开放的大船,扬帆起航。 这是三十年后的地摊货?不不不,这在现在是潮流。 你是混社会的?打打杀杀没前途,跟我一起做公益吧。 你会管理?那这家公司交给你打理。 咱们老板去哪里了?听说好像在哪个五线城市开小超市呢。 咱们老板又去哪里了?听说好像在非洲某个国家打内战呢。 咱们老板又又去哪里了?听说好像在南海某个小岛钓鱼呢。 咱们老板又又又去哪里了? …… 没有大的志向,却创下了偌大的家业,面对着巨大的财富,却不懂得如何去享受,依然只是抽着十几块钱的烟,喝着自家酿的酒。易钊意外获得最强娱乐系统,在娱乐圈一路披荆斩棘,成为顶流 。苍生之下皆是一遍苦难,而人的心却要比妖魔还要恐怖上几分。这乱世之中所存在的一切究竟是对是错?在经历了种种磨难的他意识到,妖何尝是妖,人又何尝是人?方有心怀正道,那才是对于苍生的救赎。 “若使人间万千生灵涂炭,星夜无光,那么我,便成为那一道光。” 大明皇于洪荒中崛起,塑造武者修炼境界的体系,吸纳万千大荒巨兽融入自身,成就神相境界,以自身血肉铸造明玄结界,保护人类繁衍生息。 九千多年后,一个少年从一处森林中缓缓苏醒过来,拥有废体的同时,竟然被认为是武神法相的拥有者。 在启明大陆中,武神在涅槃境失败后,可以选择转生,转生成功的人,在武灵的法相阶段,会展露出一个人影虚影,俗称“武神法相”。 在这个世界,他将秉承大明皇的意志,化身世界法则,对抗玄明结界外的洪荒兽潮。 “李揽雀,我将跨越你,迈向天下。” “接下来,我将以神相的形态出击。” 本书为原创长篇小说,分为两部。分别是上篇《亿兆富翁的百日蜕变》,下篇《亿兆富翁的二潜舰队》。 描写的是男主角“乌鸟炎”由都市普通人意外成为《亿兆富豪》栏目的幸运观众,从而开启了一段新的人生。
重生:二郎神助我删号重修 墨青帝 玄能纪元 电竞之路:昂狮 大秦第一熊孩子 被闪电击中意外获得异能 玄幻:我的灵气能化万物 末日中的审判者 玄幻:我的功法无限升级 全球观众强迫我修仙证道 大梦浮屠录 无限重置 我带着面板在诸天轮回 我在末世升级 转生龙与精灵乱舞! 九魂乱世 中等人 末世超级农场 剑鞘插刀 让你代管经纪公司,怎么都成巨星了 电视剧里的酒吧 电视剧真命天子下载 冒牌英雄电视剧28集 电视剧(璇流 电视剧里的酒吧 电视剧妈妈的爱情演员表 最好看的灰姑娘电视剧有哪些 香港断案电视剧 电视剧里有个叫乔生 林宇中的电视剧原点 林河政法委书记电视剧 最新好看警匪片电视剧 梦圆何方电视剧下载 色戒电视剧介绍 电视剧曾克林 湄公河大案电视剧莫雄 最好看的灰姑娘电视剧有哪些 电视剧里有个叫乔生 电视剧不收费网站 楚乔传全集的电视剧 电视剧真命天子下载 东游记电视剧土豆视频8 电视剧大刀记57集 电视剧爱情开头的名字大全集 色戒电视剧介绍 梦圆何方电视剧下载 电视剧里有个叫乔生 电视剧大刀记57集 电视剧不收费网站 电视剧里有个叫乔生 湄公河大案电视剧莫雄 电视剧真命天子下载 马天宇和mike演的电视剧 楚乔传全集的电视剧 梦圆何方电视剧下载 湄公河大案电视剧莫雄 幽灵犬的那部电视剧 最好看的灰姑娘电视剧有哪些 梦圆何方电视剧下载 幽灵犬的那部电视剧 湄公河大案电视剧莫雄 猜一电视剧下载 迅雷下载 迅雷下载地址 电视剧隐爱结局是什么意思 最新好看警匪片电视剧 电视剧爱情开头的名字大全集 电视剧真命天子下载 林河政法委书记电视剧 马天宇和mike演的电视剧 电视剧母爱如山39集 马局是什么电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 原来我真是世外高人 我在妖邪世界无限制升级 魂穿之我是雷帝 我不是剑仙啊 傻小子进城了 快连下载 亚星游戏官网 亚星官网 快连下载 亚星管理平台 电视剧曾克林 电视剧何以笙箫默所有的歌 湄公河大案电视剧莫雄 tfphone演过什么电视剧 猜一电视剧下载 迅雷下载 迅雷下载地址 猜一电视剧下载 迅雷下载 迅雷下载地址 电视剧隐爱结局是什么意思 电视剧曾克林 电视剧妈妈的爱情演员表 湄公河大案电视剧莫雄 楚乔传全集的电视剧 香港断案电视剧 冒牌英雄电视剧28集 梦圆何方电视剧下载 幽灵犬的那部电视剧 周五有什么电视剧更新吗 电视剧隐爱结局是什么意思 林河政法委书记电视剧 tfphone演过什么电视剧 tfphone演过什么电视剧 猜一电视剧下载 迅雷下载 迅雷下载地址 香港断案电视剧 电视剧母爱如山39集 电视剧隐爱结局是什么意思 电视剧里有个叫乔生 tfphone演过什么电视剧 电视剧曾克林 东游记电视剧土豆视频8 电视剧爱情开头的名字大全集 最新好看警匪片电视剧