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
天伦电视剧吴琳琳电视剧断桥20天伦电视剧吴琳琳义道电视剧啥时播刺青电视剧第23集英雄电视剧谢天华版被雷劈 电视剧天伦电视剧吴琳琳霍元电视剧老版80图片东方电视剧中央热门电视剧妇道天伦电视剧吴琳琳豫湘桂会战电视剧不孝敬父母的电视剧有关大秦帝国的电视剧东方电视剧中央白朗 电视剧一村之长电视剧插曲一村之长电视剧插曲国防生电视剧花絮战昆仑电视剧播放一村之长电视剧插曲霍元电视剧老版80图片初尝禁果的电视剧刺青电视剧第23集黄磊和孙红雷演的电视剧义道电视剧啥时播初尝禁果的电视剧国防生电视剧花絮豫湘桂会战电视剧半人半妖的他;提着修罗魔刀,踏上尸山血海的修罗路,一刀,一式,一人,灭魔,诛神,斩天道。这是一个有异能的世界,常人得仙人点化成为异者,异者得到异能后杀掉在大陆作乱的妖魔鬼怪。异能有金,木,水,火,土五种,一般人一生只能使用一种。 吴晨!A市第一初中的普通初中生,意外得仙人点化身怀异技,这在常人都会以为从此走上了人生巅峰,但吴晨却拒绝了仙人,这在旁人拒绝了这种非人能力的机会仙人是看都不看一眼的,吴晨被仙人选中也跟他的身世家族有莫大的关联,他祖上就是干这一行的,他自然也要继承衣钵。他这种情况在他身边有很多却不能让常人知道,所以有秘密的组织会,特定的人被仙人点化的异能都大不相同却都在五行之中,金,木,水,火,土。而吴晨跟他们不同他可以操控这五行之中任何一种并随意切换。这也是仙人必须点化他的原因之一。仙人点化常人成为异者,异者则用仙人点化的异能收拾在和平大陆作乱的妖魔鬼怪。才有了和平大陆Z国。你也可以说他们是这片大陆的守护者![温馨提示!故事乃虚构,切勿当真,三克油]有着一群不为我们所知的人,他们被称为玄元者,他们生活在这个世界,却不与我们现同,他们的故事也鲜为人知。在这个人人都是重生的世界里面,每个路人甲都绑定着五花八门的主角系统,而我?不需要!开玩笑嘛?我可是千古一帝的转世!是在刚开始修行就能硬刚创世神的存在-_-,虽然战绩可能有点难堪,但是!这种精神就很可贵嘛——?行者,走遍天地间,只为寻求众生存在的真正意义;为求一缕光明和一线生机。血源大陆,血脉为重,血气为饮,弑天剑仙,战九天十地,破九幽,称霸一帝。这是一个血脉大陆,武道分八重:引血镜,混元镜,空冥镜,幻化镜,地仙镜,天仙境,斗宗镜,大帝镜.....我叫王浩,人如其名一个普通人,从小就梦想发财。18岁以前一直过着普通的生活,直到上山摘草药,误闯一个神秘的小村庄一切都发生了改变…宇宙似乎很宏大,但却小之又小,宇宙之外是虚空,虚空里是什么呢? 时间是最快的速度吗?时间之后会产生什么呢? 多元宇宙的探索,科技的进步。人们也开始进入时间之中。 剩下的时间里会出现几个自己呢? 他们是残余,还是自己是残余。 残余本来就是剩下的!尘寰外,碧海中,桃花之间桃花岛。秋风起,海波兴,几度潮来听玉箫。且看东邪黄药师传人,如何纵横都市。满天神佛朝我跪拜,天下美女唯我独揽!已完本,放心阅读。武则天:“李余,真是朕的好孙子,我大唐的骄傲!” 狄仁杰:“李余是我见过最完美的人!” 李白:“看了李余的诗,我忽然发现自己不会了。” 李隆基:“李余是个坏人!” 李余:“你们不用夸我,我只是一不小心就造了盛世而已,很普通的啦!”
玄幻之我是半个大师 一剑凌尘西边来 都市:系统逼我当人渣 系统之诸界联盟日记 超级警员申请出战 史上最强创业系统 王者在上之灵域之眼 那小子竟然是洪门大佬 奶爸的黄金农场 小农村的离奇故事 叶飞扬 我本一书生,娶妻万人屠! 完美吞噬之魔道封神 穿越成为魔法师 清醒大师 万世之无敌 我不是李剑 不见当年剑仙来 咸鱼的自我救赎 覆手为雨2022 电视剧致单身男女简介 潜罪电视剧完整版 白朗 电视剧 刺青电视剧第23集 电视剧致单身男女简介 电视剧继承人全剧介绍 电视剧深夜食堂刘昊然 电视剧浪迹天涯 黄磊和孙红雷演的电视剧 按照剧情找一部抗战电视剧 霍元电视剧老版80图片 陀螺的电视剧 郭晓然演过的电视剧 潜罪电视剧完整版 英雄电视剧谢天华版 刺青电视剧第23集 电视剧深夜食堂刘昊然 黄磊和孙红雷演的电视剧 战昆仑电视剧播放 天伦电视剧吴琳琳 潜罪电视剧完整版 有关大秦帝国的电视剧 电视剧断桥20 不孝敬父母的电视剧 东方电视剧中央 郭晓然演过的电视剧 黄磊和孙红雷演的电视剧 电视剧断桥20 战昆仑电视剧播放 黄磊和孙红雷演的电视剧 刺青电视剧第23集 潜罪电视剧完整版 大陆禁播的电视剧 英雄电视剧谢天华版 初尝禁果的电视剧 刺青电视剧第23集 大陆禁播的电视剧 白朗 电视剧 郭晓然演过的电视剧 有关大秦帝国的电视剧 义道电视剧啥时播 按照剧情找一部抗战电视剧 白鹿原电视剧有床戏吗 电视剧深夜食堂刘昊然 不孝敬父母的电视剧 潜罪电视剧完整版 陀螺的电视剧 义道电视剧啥时播 郭晓然演过的电视剧 被雷劈 电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 全民领主:我的运气无敌了! 恒幻如梦 神谕引道 澧水悠悠梦 突然就被告知他结婚了 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 黄磊和孙红雷演的电视剧 电视剧因为爱情有奇缘 白鹿原电视剧有床戏吗 战昆仑电视剧播放 不孝敬父母的电视剧 不孝敬父母的电视剧 电视剧致单身男女简介 黄磊和孙红雷演的电视剧 霍元电视剧老版80图片 白鹿原电视剧有床戏吗 电视剧继承人全剧介绍 刺青电视剧第23集 东方电视剧中央 战昆仑电视剧播放 郭晓然演过的电视剧 潜罪电视剧完整版 电视剧致单身男女简介 豫湘桂会战电视剧 战昆仑电视剧播放 好看的高中生电视剧 一村之长电视剧插曲 一村之长电视剧插曲 电视剧致单身男女简介 电视剧致单身男女简介 霍元电视剧老版80图片 好看的高中生电视剧 黄磊和孙红雷演的电视剧 初尝禁果的电视剧 天伦电视剧吴琳琳 按照剧情找一部抗战电视剧