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   【近期经历】:..... 从此天风大陆多了一个左拥右抱,醉生梦死,羡煞旁人的...不知名大佬。当黑暗侵袭,有人跪下,有人放弃。 而我们,会鲜血流尽,战斗到底。 而我,就是这诸天万界的主!演唱会上,天后苏柒随机抽选了一位幸运观众,邀请与其一起合唱。 没想到,竟然点到了一个假粉丝! “那个,我能唱首原创吗?” 面对这种“冒犯”的要求,天后哭笑不得,但还是允许了。 没想到,这观众一开嗓,便是惊艳全场! “好家伙,来砸场子的?” …… 他就是写出《平凡之路》的顾城! 一个天才作家,网剧鼻祖,流行天王…… 还有,天后的老公!一个古老的地球,人类的文明纵使再辉煌,这短暂的历史也让人怀疑中间是否有着或短暂、或长久的空白。过去的人类无法去深究这一问题,他们还在为自身生存而担心,当人类完全摆脱环境的限制之时,深埋在内心的那颗好奇的种子得到了灌溉,猛烈地发芽,冲出物质的泥层,带领人们走向一切的未知…… 一座座远久的遗迹在各种科技下荡涤了历史车轮的车辙,各国争先派出专业人员,试图一探究竟的同时,在这些历史的建筑中,寻找未来文明发展的一丝光亮。 “华夏九星,在此领命,定在遗迹之中,拨云见日,为祖国,为人民找到未来的出路。”万古第一佛,万古第一神佛,太古第一佛,太古第一僧,太古第一神。华夏少林寺大和尚释永心修炼100年,证得罗汉道果。虹化飞升,抵达异界,再度开启新的篇章! 焚身以火,让业火烧熔我;燃烧我心,唱出佛的颂歌。燃烧色身,投进佛的圣火。我不愿意,让五蕴埋葬了我。 焚心以火,烫上佛的深烙。燃烧的心,不让贪嗔痴埋葬了我。燃烧色身,投进佛的圣火七夕出生于七月初七,儿时体弱多病,家道中落,受尽欺凌。终激活仙脉,能文能武,文,读书过目不忘,先知先觉后3年人间事,武,太极八卦拳,练成独门神打绝技,且看他,学业和事业上一路高歌,不为官,只为商,终成一方商业霸主,江山如画。 陈阳穿越到了高武世界,获得了一个能查看人生剧本的系统! 这人生剧本,能预知人未来,查看命格,甚至连对方的最近机缘都一目了然! “绝世机遇!?不好意思,我先收为敬!” 三流的主角等机缘。 二流的主角找机缘! 而陈阳:机缘在哪,我就在哪! 转生,陌生又冰冷,或不是你的声音,冰冷的语气又或者在一次次转生中找寻真正的结局。
娱乐:开局疯狂爆料 满级悟性系统 玄武裂天 陨石与冰 元世界:异度空间 丧尸末世:开局学会小李飞刀 异世之仙路奇缘 普通修炼 飞水龙吟 我本不想做英雄的 包子迷你世界 主播在线吃鸡 19特区 重生之我的辉煌人生 真实之幻 左手魔法右手修仙 一剑飞雪任平生 逆下 浪迹异星 我是个阴阳师 狗狗心脏病怎么治疗 狗狗细小早期吃什么药 狗狗下楼梯的图片 狗狗细小为什么会拉血 狗狗心脏病怎么治疗 狗狗性情大变变的好凶 狗狗下楼梯对狗的伤害 狗狗细小怎么自己治疗方法 狗狗心脏不好吃什么药 狗狗细小中药治疗方法 狗狗先剪毛还是先洗澡 狗狗下一个崽什么原因 狗狗蔫吧不吃食嗜睡 狗狗细小早期吃什么药 狗狗眼睛里有虫的症状 狗狗细小晚上发热吗 狗狗下楼梯对狗的伤害 狗狗心脏不好吃什么药 狗狗心脏病三级 狗狗细小痊愈后不喝水 狗狗细小早期吃什么药 狗狗细小如何隔离 狗狗细小要治疗几天 狗狗心脏病怎么治疗 狗狗血尿有什么秘方 狗狗细小中药治疗方法 狗狗细小怎么治才会好 狗狗细小要治疗几天 狗狗细小为什么会贫血 狗狗细小怎么治才会好 狗狗心脏病三级 狗狗性情大变变的好凶 狗狗先剪毛还是先洗澡 狗狗下楼梯的图片 狗狗细小怎样治疗 狗狗心脏病三级 狗狗先剪毛还是先洗澡 狗狗细小如何隔离 狗狗细小中药治疗方法 狗狗下一个崽什么原因 狗狗消炎针多少钱一针 狗狗眼挡住眼球 狗狗细小自己能治愈吗 狗狗细小晚期怎么治疗 狗狗心脏病怎么治疗 狗狗性情大变变的好凶 狗狗细小晚期怎么治疗 狗狗消炎针多少钱一针 狗狗细小中药治疗方法 狗狗细小痊愈后不喝水 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 玄傲传 参宇 灵霄之下 我在靖安司悬壶三十年 惶恐的我 亚星管理平台 澳门葡京官网 AG真人 亚星管理平台 万利官网 狗狗先剪毛还是先洗澡 狗狗细小晚期怎么治疗 狗狗心脏不好吃什么药 狗狗细小早期吃什么药 狗狗细小痊愈后不喝水 狗狗下楼梯对狗的伤害 狗狗下楼梯的图片 狗狗细小什么症状 狗狗细小晚期怎么治疗 狗狗眼睛会长什么东西吗 狗狗细小早期吃什么药 狗狗细小晚上发热吗 狗狗细小自己能治愈吗 狗狗细小怎样治疗 狗狗心脏病怎么治疗 狗狗细小为什么会贫血 狗狗先剪毛还是先洗澡 狗狗性情大变变的好凶 狗狗细小自己能治愈吗 狗狗细小痊愈后不喝水 狗狗心脏病是先天性的? 狗狗下楼梯的图片 狗狗细小要治疗几天 狗狗细小什么症状 狗狗细小什么症状 狗狗眼睛会长什么东西吗 狗狗眼睛里有虫的症状 狗狗血尿有什么秘方 狗狗细小为什么会拉血 狗狗细小怎么自己治疗方法