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
鄂州火车站到蕲春汽车站时刻表泰州有到到桂林的火车吗零陵到株洲火车票价查不嘎至北京的火车时刻表郑州火车站铁路鄂州火车站到蕲春汽车站时刻表枝江火车站能直达哪些站零陵到株洲火车票价t66是什么火车湛江一海口火车票预定太原至湖北宜昌火车鄂州火车站到蕲春汽车站时刻表长沙至西宁火车卧铺太原至湖北宜昌火车零陵到株洲火车票价湛江一海口火车票预定佳木斯-青岛火车票多少钱侯马到涿州火车侯马到涿州火车盐城到长春火车车费广州至福州怎样做火车票k1614 火车 座位四平至杭州市火车票价湛江---新乡火车时刻表郑州火车站铁路周口至郑州火车1211查不嘎至北京的火车时刻表佛山南海有没有公交车到火车站盐城到长春火车车费长沙至西宁火车卧铺反派拥有一个救世之心会怎样,当心成为挂件,摘下就是反派性格,装上就是救世之心,想做好人做好人,想做反派做反派,所谓人善被人欺,既不会被道德捆绑,又不会善良被人欺负。摘下心,变幻莫测,我便不是我。【咸鱼+系统+单女主+御兽+日常轻松】 楚紫:前世我是扑街写手,整日辛苦码字,最终劳累致死,这一世我变成了皮卡丘,化身咸鱼! 黎姝:前世我是女帝,弹指间山河崩陷,这一世同样要走上人族之巅,守卫人族! 楚紫:作为一个有咸鱼系统的皮卡丘,我只想做做每日任务获得咸鱼值,然后买点属性丹,升级成神兽。 黎姝:作为SSS级初代神兽,你不能每天吃饱睡觉调戏我,你要勤奋修炼,与我一同站在人族之巅,驱逐异族守卫人族!等等,你怎么有万千大道了?还有,你怎么把自己躺成天道了? 楚紫:变强非我愿,我只想躺平享受人生!世界变了模样,我既然有了这样的能力,那就让我试试吧......【叮,您的神级搞钱系统已激活!】 伴随着系统的提升声,李凡终于明白了人生的真谛:那就是拼命的搞钱! 李凡借助系统给予的能力,卖配方、开面馆、创业投资一条龙。 秘制水煮肉片,鲜美嫩辣! 天外香炸鸡腿,外酥里嫩! 神级土豆牛腩,酱香浓韵! 除了各种自创顶级菜品外,还有蒸羊羔、蒸熊掌、蒸鹿茸、烧花鸭、烧雏鸡、烧子鹅、卤煮咸鸭、酱鸡、腊肉、松花、小肚儿、晾肉、香肠……等绝味厨艺! 从面馆开始,李凡创业后倚靠着无数神级配方在美食界横行霸道、平步青云的故事拉开序幕…… 无数的故事,编织成了这个世界。福无双至祸不单行。法洛斯大陆先失去了日月陷入永夜,随后势不可挡的冰魔大军又渡海而来毁灭了大陆诸国,奴役了人类一百年。 百年后,一位神秘的青年用火焰魔法驱逐了冰魔,自身化作新的太阳照耀大陆,被人类尊为火神。 但火神未能带来真正的和平。各类魔物仍不断接踵而来,新生的人类帝国培养了有着超人体能、感官的猎魔士。 作为新晋猎魔士的男主角李奥,因解救了在打猎时遭到魔物袭击的皇帝,被皇帝提拔为贴身侍卫。可之后不久,皇帝遇刺亡,公主遭到绑架,李奥被当成了凶手。 在为自己洗刷冤屈的过程中,李奥发现了猎魔士的起源,却也因此使猎魔士和人类对立起来,直至爆发内战。 对人类失望的火神再次现世,企图毁灭一切。在李奥爆发出自身隐藏的未知力量后,火神和战争被阻止了。李奥也为了调查太阳消失的真相,踏上了在穿越世界的旅行…… 我是一个老千,为了报仇,我坐上赌桌,以千术把仇人踢进赌博的深渊。老千生涯,靠赌为生。三教九流,江湖百态。 赌桌上,没有常胜将军,输一次,万劫不复。都说庶子与家产无缘,但林弘却不这么认为,看上的东西,不给就抢,才是王道……天族小殿下惊天落难,被隐士老人古月所救,从此她身边多了一个陪伴的人,两人相互帮助、相互慰藉,两小无猜,青梅竹马,他说过长大以后要娶自己,为了能让她活着,惊天独闯龙潭虎穴寻地火,一人大战千人得阴风珠,然而命运捉弄相爱的人,应为身份差距分开。为了能见到他,为人能和他在一起。她吞地火,食阴风珠,闯地狱得寒冰神髓,过关斩将得天火,历经千辛万苦成为世界强者,她满坏欣喜的去找他,却发现他要大婚了,无数次幻想的新娘不是自己,他们会不会在一起,请看王静如的寻夫之旅,在高度发达的人类社会 ,人类发现越来越多古老而神秘的生物,远古生物仅仅出现在人们眼中 ,那些不被人类所认可的上古生物 。认为并不存在的上古凶兽 ,随着一次灾难渐渐浮现 。一个神秘的组织 ,不为世人所知,他们拥有远超人类的科技水平 ,一直在观察着这些古老的生物 。让它们们不会出现在人类面前 ,而这个组织由一群特殊的人们组成 ,他们基因被改造,使得他们远超常人 。他们本来的目的是观测,而近些年来 。上古凶兽出现越来越多越来越多生物发生变异 ,他们渐渐再也无法阻止它们,于是这个组织由原来的观测,改为了对他们的斩杀 。这些人被他们所称为,猎杀者,他们不被世人所知,一直默默的守护着人类 ,尽管为此付出生命。而渐渐,事态超乎人们的想像他们再也无法阻止他们,它们终于显露在人们的面前 ,人们奋起反击 ,可这又能改变些什么 。在这样的绝境中,人类究竟如何才能胜利,又会有谁带领他们走向胜利,人类和凶兽之间的纷争又将会如何 。最终,究竟有时谁会胜利
再生世界 修真仙械师 全球御兽:开局觉醒SSS级天赋 命里成仙 反派:记忆曝光,女主跪求我原谅 爷爷地府造反,我在人间直播 无敌兵王 有妖越界 真我传之尘间旧事 晨昼 诸天道种 玩家还是玩具? 君临地球玩逆袭 大明武林那些事 从前有座山海观 跨界神石 武侠世界的慕容复 想躺平,可我的机宠太卷了 太易神界 逍遥小里正 盘锦到牡丹江火车时刻表查询系统 北京市到葫芦岛市火车时间 湛江一海口火车票预定 海口到武昌火车路线 盘锦到牡丹江火车时刻表查询系统 四平至杭州市火车票价 准安至徐州火车时间表 郑州火车站铁路 嘉兴 泗阳 火车 k1614 火车 座位 长沙至西宁火车卧铺 长沙至西宁火车卧铺 广州至福州怎样做火车票 查不嘎至北京的火车时刻表 周口至郑州火车1211 盐城到长春火车车费 准安至徐州火车时间表 嘉兴 泗阳 火车 枝江火车站能直达哪些站 连云港到长垣的火车 北京市到葫芦岛市火车时间 佛山南海有没有公交车到火车站 佳木斯-青岛火车票多少钱 鄂州火车站到蕲春汽车站时刻表 查不嘎至北京的火车时刻表 广州至福州怎样做火车票 嘉兴 泗阳 火车 佳木斯-青岛火车票多少钱 广州至福州怎样做火车票 周口至郑州火车1211 侯马到涿州火车 公主岭到伊通的火车站 查不嘎至北京的火车时刻表 鄂州火车站到蕲春汽车站时刻表 湛江---新乡火车时刻表 郑州火车站铁路 北京市到葫芦岛市火车时间 盘锦到牡丹江火车时刻表查询系统 湛江---新乡火车时刻表 北京市到葫芦岛市火车时间 郑州火车站铁路 前旗到包头的火车站 盐城到长春火车车费 嘉兴 泗阳 火车 太原至湖北宜昌火车 公主岭到伊通的火车站 四平至杭州市火车票价 郑州火车站铁路 芜湖市到杭州火车站 枝江火车站能直达哪些站 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 唱歌就能救妹妹,我唱疯了 大宋驱魔人 灵异故事杂谈 黎命 普通大学生的自传 欧博官网 百家乐官网 亚星管理平台 欧博官网 亚星管理平台 惠州到荆州火车时刻表查询 前旗到包头的火车站 佛山南海有没有公交车到火车站 惠州到荆州火车时刻表查询 盘锦到牡丹江火车时刻表查询系统 周口至郑州火车1211 盘锦到牡丹江火车时刻表查询系统 k1614 火车 座位 四平至杭州市火车票价 侯马到涿州火车 鄂州火车站到蕲春汽车站时刻表 太原至湖北宜昌火车 泰州有到到桂林的火车吗 湛江一海口火车票预定 泰州有到到桂林的火车吗 鄂州火车站到蕲春汽车站时刻表 周口至郑州火车1211 泰州有到到桂林的火车吗 侯马到涿州火车 周口至郑州火车1211 湛江---新乡火车时刻表 郑州火车站铁路 芜湖市到杭州火车站 连云港到长垣的火车 海口到武昌火车路线 盘锦到牡丹江火车时刻表查询系统 准安至徐州火车时间表 嘉兴 泗阳 火车 零陵到株洲火车票价 盐城到长春火车车费