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
租赁管理软件360中英翻译软件破解下载租赁管理软件360vip格式用什么软件看手机改变mac地址软件最新版钣金软件增加音乐音量的软件租赁管理软件360什么软件控制cpu音量测量软件下载所有越狱后安装的软件闪退怎么回事租赁管理软件360360免费的数据恢复软件机打发票软件怎么装mac 软件字体大小音量测量软件下载flymcu软件那个用录音软件好用那个用录音软件好用话筒效果软件哪个好用多多赚手机软件那个用录音软件好用什么软件控制cpu有什么软件定时提醒手机改变mac地址软件win7怎么禁止软件安装vip格式用什么软件看有什么软件定时提醒话筒效果软件哪个好用360免费的数据恢复软件这是一部描写人在世上活着所要面对的事实与挫折,让主人公懂得了什么才是活着需要的东西。 主人公从懵懂无知的少年到一个身经百战的中年,其中的心酸与磨难,让他更加珍惜现在的生活,其中包含的酸甜苦辣,也只有身在其中才能满满体会,由甜至苦,让人感触颇深。何为天道?制定世间规则的无上神吗?或许自诩“正义”的天道才是应该被抹去的一方呢?你有你的坚持我也有我的坚守,如果你所坚守的正义终将成为我的敌人…… 如果挡在我面前的是这世间的一切,那么就让整个世界重启好了。 “下辈子,希望我们还能成为朋友……”这片大陆名叫天海山,这里的人们以武为尊,以武会友,以气破镜重圆,以力相濡以沫。 这里的人们信仰修习能量,突破境界。 可人们争强比拼,要得到的是什么?是力量?是钱权?还是彼此? 活着的时候冷暖自知,搭配百味人生,读着读着这本书,相信我们可以渐渐知道人生的价值意义!喜看网文事业成功的男主,意外落崖之后穿越到自己熟读十余遍的小说世界中,而男主雷震凭借着前世的能力和对异世界的熟悉,重整异世、道心屠魔 破界寻妻! 男主做事果决,飒爽干练,故事逻辑严谨清晰,可以细品。讲故事,很用心,跟我来,不后悔……一柄剑,一个人 斩这天,破苍穹南方的隽国与北方的图国连年战乱不休,而万千妖鬼正乘此时机祸乱世间。此危难之际,诚心林的三位少年挺身而出,为击败那“饿鬼王”而在世间行侠仗义。 这部作品的大体背景是南宋初期,隽国(宋)和图国(金)交战的时间。出现了一些历史人物为原型的人物作为点缀,并加了一些妖鬼之类魔幻的元素。笔者想创立一个庞大的世界观,所以在其中还添加了一些同时期中世纪西方的元素,比如十字军骑士和魔法,如果笔者在写作过程中将其和东方元素融合不当,请读者见谅。世间,是否只是黑与白 任何不被认可的,难道就都是“暗” 若世间不去探求真理,那便让真理,来诠释这乱世当刚登基为王的嬴政融合一个后世之人的灵魂并得到一幅江山美人册时。嬴政:朕,爱江山更爱美人!!!天穹界,一个少年因为一本神秘阵图穿越到了这个世界。 偶然间少年突然得知这是一个可以长生久视的世界,一个机缘巧合,少年拜入七大宗门之一的五行宗。 “大罗金仙血染裳,好大的杀气。” 少年看着对面的异道随意的开口道:“请入阵一观!” 一道流光闪过,男子口吐鲜血:“这是何物?” “此宝名曰:“攒心钉”&amp;quot;少年看着吐血倒地的男子微笑道。 中州末年,天下大乱! 皇帝昏庸无道!民众水深火热! 一时间山精野怪横行!妖魔鬼怪霍乱!人间气数已尽! 全家惨遭灭门!背后是何阴谋? 看主角如何爬出谷底!步步为营! 对抗妖魔!拯救苍生! 寻宝探奇!终究造神!
恐怖游戏:我是鬼屋NPC 潮起之时 班上不说话的怪同学 剑寒君心录 率土之凨云再起 洪荒:开局变成大道 我,皮卡丘,女帝的咸鱼伴生兽 美漫之绝对掌控 续玉 驭心志 昱皇大帝国 当代酒神 巨变的世界 混沌剑神 探案前和清冷影后契约结婚 围子八仙群英传 小爷我不是公子 花花世界你侬我侬 穿越异世界的我竟是垫脚石 神之末代 ios9越狱部分软件闪退 vip解析软件最新 flymcu软件 手机改变mac地址软件 ios9越狱部分软件闪退 辽宁省通用发票打印软件 光盘删除数据恢复软件下载 gta5相关软件 win7怎么禁止软件安装 360免费的数据恢复软件 什么软件控制cpu 钣金展开3d软件 动作的图片设计软件 vip解析软件最新 最新版钣金软件 手机改变mac地址软件 光盘删除数据恢复软件下载 win7怎么禁止软件安装 多多赚手机软件 租赁管理软件360 vip解析软件最新 mac 软件字体大小 中英翻译软件破解下载 机打发票软件怎么装 音量测量软件下载 动作的图片设计软件 win7怎么禁止软件安装 中英翻译软件破解下载 多多赚手机软件 win7怎么禁止软件安装 手机改变mac地址软件 vip解析软件最新 通用机打发票要下软件? 最新版钣金软件 有什么软件定时提醒 手机改变mac地址软件 通用机打发票要下软件? flymcu软件 动作的图片设计软件 mac 软件字体大小 vip格式用什么软件看 越狱后越狱软件闪退怎么回事 电视机hdp直播软件怎么安装 钣金展开3d软件 机打发票软件怎么装 vip解析软件最新 钣金展开3d软件 vip格式用什么软件看 动作的图片设计软件 增加音乐音量的软件 亚星游戏官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 奇诡水灵师 倾城绝丽 军临城下之护卫者计划 大仲帝国末代风云录 神龙元素 亚星官网 万利官网 欧博游戏官网 亚星官网 葡京官网 360免费的数据恢复软件 电视机hdp直播软件怎么安装 电视机hdp直播软件怎么安装 win7怎么禁止软件安装 辽宁省通用发票打印软件 多媒体教室软件 免费 中英翻译软件破解下载 钣金展开3d软件 话筒效果软件哪个好用 通用机打发票要下软件? 五笔软件排行 多媒体教室软件 免费 vip解析软件最新 flymcu软件 那个用录音软件好用 多多赚手机软件 360免费的数据恢复软件 电视机hdp直播软件怎么安装 电视机hdp直播软件怎么安装 增加音乐音量的软件 flymcu软件 gta5相关软件 多多赚手机软件 光盘删除数据恢复软件下载 动作的图片设计软件 win7怎么禁止软件安装 360免费的数据恢复软件 什么软件控制cpu 租赁管理软件360 增加音乐音量的软件