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
钱排客车珠海电话德邦物流新都街道电话号码钱排客车珠海电话皇姑社保中心电话广州金都酒店电话瑞金欧利大酒店电话昆山美团客服电话多少钱达州到西安大巴电话中山古镇华友物流电话濮阳市五院电话附近大同市神话ktv电话钱排客车珠海电话北大万柳学生公寓电话平利爱家家政电话达州到西安大巴电话濮阳市五院电话腾鳌美团业务电话哈尔滨市宜家超市电话号码哈尔滨市宜家超市电话号码去哪儿 北途旅行 电话朝阳县成大方圆药店电话哈尔滨市宜家超市电话号码中山古镇华友物流电话北戴河杜晓书电话广州金都酒店电话湖北瞿家湾联系电话皇姑社保中心电话北戴河杜晓书电话去哪儿 北途旅行 电话北大万柳学生公寓电话为救一名女孩,左化羽灵魂来到了恶灵大陆。 恶灵大陆是恶灵横行的大陆,在这里人类时刻被恶灵的恐惧支配着。人类为了摆脱这种舒服,开启了修炼之路。 这里的人想要修炼,必须开启本命之灵。随着本命之灵的强大,才能提升自己的修为。 左化羽在偶然的机遇下,得到了世间最强本命之灵青锋剑匣。本想修炼能游历大陆,可随着而来的也将是亲人的遇难,左化羽的道路也变得扑朔迷离……降临全球的超凡事件,一纸神秘的契约…… 苏醒与死亡共舞,穿梭在三界与人间,在一次次试炼任务中险死还生,洞见真相。 鬼街打更人、妖界摆渡者、天界放马官!苏醒一步一个脚印,做大做强,再创辉煌。 本书又名《内卷》,《往死里卷》《TM谁都别想卷过我》《扶我起来我还能浪》 ———————— 小二寄语:今天五更,再废话十更。江波重生了! 前世的他,庸庸碌碌,错过了应该珍惜的一切! 上天既然给了他重生一次的机会,他要凭借上一世的经验和记忆,成为最年轻的金融天王!全球第一股神!吊打华尔街金融大鳄。 江波:“钱只是身外之物,我的女人,才是我的一切!” 【单女主文】穷学生狗剩母亲被恶霸害死,无力报仇雪恨,绝望想要自杀。不想曾因自己救过一的条小蛇,意外获得蛇灵传承。在亲友的帮助下,完美复仇,并屡获奇遇,领悟人生真谛!正所谓一念善,万水千山,一念恶,苦海无边。正义和邪恶争斗永不休止,无论身处如何绝境,只要心存善念,都将化险为夷。不管现在有多牛逼,一旦恶意丛生,必将万劫不复!霸王再次醒来时,眼前是一片夕阳,乱军厮杀的声音犹然在耳…… 高粱河,一个对于宋人来说久久不能平复的地方,手中的霸王枪熠熠生辉,这一次,好好来! 公元979年,项羽于高粱河大破辽国,收复燕云。 而后,展开了他征伐天下的宏梦。 攻西夏、破大理、复西域、征东瀛。 拜占庭、阿拉伯、还有你什么神圣罗马帝国帝国 也得倒在我拔山扛鼎的气势之下! 亚欧大陆尽在掌握! 虞姬,你看到了吗?你的男人,成为了这世界之王!为了男人的承诺,萧晨强势回归,化身美女总裁的贴身保镖,横扫八方之敌,谱写王者传奇!   他——   登巅峰,掌生死,醒掌天下权,醉卧美人膝! —————— 小舞的微信公众号:寂mo的舞者,可以去关注哦! 小舞的QQ:1589045849,可以去加好友! 唯舞独尊①群:545765633!   春雨一夕了无痕,如这雨一般,我是谁,去往何处。看陆雨在寻找自己的过程中,怎样诛灭神魔。校园穿越小说文 他穿越了! 就想悄悄修个仙! 待到一飞冲天,看他踏破九霄,斗破苍穹!每个人心里都住着一个齐天大圣,我们都曾爱憎分明头角峥嵘,向往着自由、热血、激情。是受尽时间洗礼,社会毒打,我们才变得圆滑世故,八面玲珑,变成自己曾经最讨厌的人。当而立之年,我们突然不在平凡,变为超凡者。我们又重新站在了十字路口,是选择继续苟且,还是追寻那曾被遗忘的热血与光。 好吧,其实故事并不复杂,就是一群老男孩们热血上头的故事,活一辈子总得留下点什么,那就一起给年轻人打个样儿! 哥几个走着!
圣灵之魄 梦囚天 妖舟 芸凉 网游之战国策 我是一个守夜的 绝武帝尊 一只骷髅的科研进化路 梵修罗Ⅱ轮回六道 破凡经 魔鬼崛起 末日终结时 娱乐:从密室大逃脱开始 突起之神 古镇老鹅 暗黑破坏神之狂怒 为美好的末世献上祝福 阎王转世录 与你最后的七日 我家女友真的超级可爱 德泰酒店人事部电话 签证电话调查会问什么 腾鳌美团业务电话 哈尔滨市宜家超市电话号码 德泰酒店人事部电话 给大使馆打电话咨询 荷兰酒店电话 中山阳光沐场电话臻园 湖北瞿家湾联系电话 北大万柳学生公寓电话 中山古镇华友物流电话 贺州市肥仔烧鹅王电话号码 台山新星酒楼电话 签证电话调查会问什么 瑞金欧利大酒店电话 广州金都酒店电话 荷兰酒店电话 湖北瞿家湾联系电话 朝阳县成大方圆药店电话 钱排客车珠海电话 签证电话调查会问什么 达州到西安大巴电话 德邦物流新都街道电话号码 平利爱家家政电话 濮阳市五院电话 台山新星酒楼电话 湖北瞿家湾联系电话 德邦物流新都街道电话号码 朝阳县成大方圆药店电话 湖北瞿家湾联系电话 广州金都酒店电话 签证电话调查会问什么 阳西西湖村委会电话号码 钱排客车珠海电话 北戴河杜晓书电话 广州金都酒店电话 阳西西湖村委会电话号码 腾鳌美团业务电话 台山新星酒楼电话 达州到西安大巴电话 皇姑社保中心电话 石家庄到昌黎高客电话 水茜镇医院电话 贺州市肥仔烧鹅王电话号码 平利爱家家政电话 签证电话调查会问什么 贺州市肥仔烧鹅王电话号码 皇姑社保中心电话 台山新星酒楼电话 昆山美团客服电话多少钱 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 异世盛燕 诡案法医神探 天地参一 坐化三千年,发小变女帝? 太阴仙途 百度 百度 百度 百度 百度 皇姑社保中心电话 北大万柳学生公寓电话 濮阳市五院电话 宝山体育馆游泳馆电话号码 荷兰酒店电话 哈尔滨市宜家超市电话号码 中山阳光沐场电话臻园 德泰酒店人事部电话 附近大同市神话ktv电话 去哪儿 北途旅行 电话 北大万柳学生公寓电话 石家庄到昌黎高客电话 去哪儿 北途旅行 电话 宝山体育馆游泳馆电话号码 昆山美团客服电话多少钱 腾鳌美团业务电话 中山阳光沐场电话臻园 北大万柳学生公寓电话 荷兰酒店电话 中山古镇华友物流电话 湖北瞿家湾联系电话 广州金都酒店电话 中山阳光沐场电话臻园 瑞金欧利大酒店电话 平利爱家家政电话 台山新星酒楼电话 北大万柳学生公寓电话 皇姑社保中心电话 宝山体育馆游泳馆电话号码 宝山体育馆游泳馆电话号码 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网