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
黑龙江宝清天气预报24时东宁15天天气情况黑龙江牡丹江市天气黑龙江省泰来县天气情况牡丹江7月下旬天气黑龙江宝清天气预报24时天气在线牡丹江黑龙江牡丹江市天气北安北安的天气预报一周齐齐哈泰来天气预报温度上海天气黑龙江牡丹江市天气绥化四月天气怎样温度上海天气黑龙江牡丹江天气预齐齐哈泰来天气预报2017年8月21日泰安天气牡丹江天气预报查询牡丹江7月下旬天气海伦天气安达天气肇东高青2017年7月天气牡丹江天气预报查询北安北安的天气预报一周海伦15天气预报牡丹江6月3日天气预报北安市天气预报一周天气预报牡丹江6月3日天气预报北京城市介绍 中国天气网海伦天气安达天气肇东泰来历年天气诡异来袭,末日降临。 动植物变异,诡异入侵。 亿万卡牌随处散落,武器卡、职业卡、装备卡、资源卡、图纸卡... 拾取卡牌强大自身,拥有抗衡怪物的实力。 建立庇护所,在夜晚,防止强大的怪物入侵。 罗锋捡起掉落在自己小卖部门口的一张卡牌。 【一星随机卡牌,选择你要获得的奖励】 罗锋发现,其他人的奖励都是随机,只有自己,可以选择卡牌里的奖励内容。 在这个怪物异常强大,卡牌出货概率极低的末世,陆尘金色传说开到手软。 “末世,有手就能生存” ...........我从小受尽委屈,原以为等成年便可自由,结果还没成年,就给我赶出去了,听话,no no这个词永远不会在我的字典里出现,哈~。报复你们,是最正确的选择,结果我穿越了,还修仙?拜托~我是学渣,某狼:呸!你可真能装! 穿越成为镇南王府的世子,本来想安安心心当一个纨绔,上街打算强抢民女,却没想到一个不小心竟然抢走了微服出宫的当朝公主!更没想到的是,皇帝不但没有怪罪,反而将公主赐婚给他!不是吧,我真的不想当驸马爷!诸神之末代,破碎的大陆,分裂的天国,诡谲的预言,所谓的神选者究竟是否能扶大厦之将倾?大神座上消失的群神,两座不知名的宏伟雕像,一千年前的神战究竟历程如何,外界入侵的群龙又到底为何而来,支持这个世界的是正义还是某个物品的谎言,而神选者又与不信者之间碰出怎样的爱恨情仇?敬请观看拙作神之末代,来领略神与人的最终篇章。少年天才于洋来到黄海市当保镖,且看他如何走上人生巅峰王富贵一觉醒来发现自己穿越到一个破落户家里,一出门还白捡了个老婆,为了养活一大家子,王富贵不得不想方设法搞钱!设计时装、建造工厂,到后来居然连手机都有了……王富贵就这么成为大夏第一号大富豪,还顺便收个皇帝做小弟!天生剑帝渡劫惨遭好友背叛偷袭,却意外重生到地球。以凡人之躯,重返巅峰灵气复苏,天地巨变,世界晋升,万族争霸。 陆渊踏足万族战场,获得神级天赋【进化之眼】 一眼便可到武将的隐藏进化路线!  【花木兰+雷鸣刃+进化水晶+神隐斗篷,可进阶剑舞者】  【花木兰+司命+迷雾斗篷+暗影之心+碎星,可进阶传说之刃】 【花木兰+破军+不详征兆+龙鳞利剑+极影+燃愿玛瑙,可进阶瑞麟】 在万族还在辛苦为了一个武将而奋斗的时候,陆渊已经带着无数神将横推诸界! 一觉醒来穿越到了修仙的世界!在走上拳碎苍穹,脚破仙宫的仙皇之路前就被自称管理穿越者的家伙抓走了。 明明是监察万千位面的穿越者管理会,却是一副…… 万千的世界生生灭灭,走向破灭无法挽回的末日次元,到达了寿命尽头的热寂宇宙。当然也有生机勃勃的异乡,新生矇昧的世界,最最重要的是到处似乎都有被穿越者搞的水深火热的世界或者穿越者正在水深火热的世界啊喂! 知道辽知道辽,穿越者管理会正在龟速受理中—— 身穿外骨骼,手持电浆剑的剑仙,来自离狐县只会犯迷糊的狐狸,被称为“大咸者”的咸鱼会长真的有在管事吗?万族林立,群英争霸,都是为了登峰之路达到顶峰,,且看他如何登峰,走出属于他的道路。这是一个属于灵力的世界。 境界划分 修血境(调动全身精血滋养己身,强身健骨) 开灵境(可将全身之力转为灵力,正式踏入修炼) 自然境(与自然万物呼应,增强实力) 极光境(与空间共鸣,可调动少量空间同属性灵力)大风境( 借助风提升灵力) 破天境(大量调动空间同属性灵力) 天一境(天人合一,有神的气息,实力远超破天) 日月境(真神,可吸收日月星辰之力) 长生(永恒)境(享受无尽寿命) 皇者(半步登峰)(几乎无敌) 帝者(登峰) (无敌)
少爷,别怕! 娘子请自重,我要写书了 异世界:法师之路 魔书江湖录 那些年,我在人间当鬼差 鬼灭之刃:无限城改编 黑与白第一季蛮荒之境 游荡VR世纪 都市:天庭地府闯人间 返虚 巅峰暗龙 大唐神级奶爸 蓝色星徽我的荣耀 无向之上 盲侠应龙 勇者与那座大山 特工孤儿院 更新时代 老陈回忆录 海贼王之云上漫游 北安ajing天气预报一周 齐齐哈尔4月分天气情况 2017年8月21日泰安天气 牡丹江7月下旬天气 东宁15天天气情况 北京城市介绍 中国天气网 2017年8月21日泰安天气 绥化4月份天气 北安市天气预报一周天气预报 绥化四月天气怎样 北安10.29天气 北安10.29天气 东北下周天气预报 齐齐哈尔4月分天气情况 黑龙江宝清天气预报24时 牡丹江7月下旬天气 2017年博山七月份天气 北安ajing天气预报一周 河南安阳、兰考天气 黑龙江牡丹江市天气 齐齐哈尔4月分天气情况 黑龙江牡丹江市天气 河南安阳、兰考天气 牡丹江天气预报查询 齐齐哈泰来天气预报 东北下周天气预报 北安ajing天气预报一周 东宁15天天气情况 河南安阳、兰考天气 北安市天气预报一周天气预报 牡丹江7月下旬天气 宁安市历史天气查询 黑龙江省泰来县天气情况 黑龙江宝清天气预报24时 海伦15天气预报 牡丹江6月3日天气预报 黑龙江省泰来县天气情况 2017年8月21日泰安天气 海伦15天气预报 黑龙江牡丹江天气预 牡丹江6月3日天气预报 绥化4月份天气 海伦天气安达天气肇东 2017年博山七月份天气 温度上海天气 宁安市历史天气查询 北安10.29天气 牡丹江6月3日天气预报 东北下周天气预报 中国天气网历史天气数据 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 围猎游戏 世末奇迹 山上那些人 同魔共舞 神生意气 欧博游戏官网 皇冠登3出租 亚星管理平台 欧博游戏官网 亚星管理平台 东北下周天气预报 北安北安的天气预报一周 宁安市历史天气查询 绥化四月天气怎样 海伦天气安达天气肇东 东宁15天天气情况 高青2017年7月天气 黑龙江省泰来县天气情况 河南安阳、兰考天气 北安市天气预报一周天气预报 黑龙江牡丹江天气预 北京城市介绍 中国天气网 天气在线牡丹江 东北下周天气预报 牡丹江天气预报查询 宁安市历史天气查询 温度上海天气 黑龙江16年4月份天气预报 北安10.29天气 黑龙江宝清天气预报24时 宁安市历史天气查询 黑龙江牡丹江天气预 黑龙江宝清天气预报24时 泰来历年天气 黑龙江牡丹江市天气 牡丹江6月3日天气预报 绥化四月天气怎样 牡丹江7月下旬天气 北安市天气预报一周天气预报 温度上海天气