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
82猴邮票价格2017邮票整顿最新消息重大事件发行哪些邮票台湾古代钱币邮票邮票行情列支敦士登 邮票196482猴邮票价格96年生肖邮票多少钱重大事件发行哪些邮票2017年凤文物邮票图片建行猴年金邮票青贵邮票交易82猴邮票价格西厢记型张邮票青贵邮票交易重大事件发行哪些邮票建行猴年金邮票邮票2016-15邮票价格查询 2O15-2邮票价格查询 2O15-2方寸邮票也能体现一个国家澳门银行邮票价格表邮票价格查询 2O15-2918邮票j169邮票的来由邮票行情列支敦士登 邮票1964濮阳邮票多少台湾古代钱币邮票2000年奥运邮票价格清代/蟠龙邮票西厢记型张邮票九州大陆,华夏历史上出现的巨大王朝,粉墨登场。 大秦嬴政,大汉刘邦,大唐李世民,大明朱元璋诸雄争霸! 嬴子夜穿越成嬴政第九子,躺平十年,刚踏入陆地神仙,就被天道金榜曝光! “武道资质榜第二:武当大师兄王也!” “武道资质榜第一:大秦九皇子嬴子夜!” 武当老祖宗:“什么?第一居然是祖龙之子!” 少林扫地僧:“这是个什么怪物?” 李世民:“此子,不能留!” 朱元璋:“派锦衣卫将嬴子夜除了!” 嬴政:“快让夜儿过来,寡人得好好问问他!” 嬴子夜:…… “我是真想低调,奈何实力不允许啊!” 东方君从小无法修炼使其实力微弱,但因一次机遇,激活了体内沉睡着的黄金圣龙,就此获得了不属于这个大陆的力量,从此实力超凡。 结束了东面西方的明争暗斗,最终成为人类的第九代战神,并渡劫成真神。秦人席道全偶遇楚人蓝世云,先后错抓进府首府衙行医,不久楚暴发虫病,席道全被召为医者,不少医者因无法治好虫病被杀,席道全逃至楚,与蓝世云重逢,又一同入秦救治民众,得到秦人赞颂。后秦君驱三十万虫病大军伐楚,蓝世匀任拒敌前锋迎战秦军,秦军闻蓝世匀之名,纷纷弃械休战,请求治疗虫病,蓝世云与席道全一同摆汤药阵为三十万秦军治病。但此时虫病传入楚,楚君得知蓝世匀与秦人席道全一同曾为敌军治病,先囚禁了蓝世匀的上司卢世宗一家,又捉拿蓝世匀与席道全,席道全趁机卷走银子逃回秦,秦君也剩机再次驱重兵攻占楚,楚君无奈启用卢世宗,同时命蓝一出与施药救治楚民,卢世宗力退九部联军,席道全也在被俘人之中,又重与蓝世匀一同到民间治疗虫病,此时战败的秦君通过外交召回席道全,其它小国也来求医,不久,在一次聚会中,众王子误杀州首之子,虫病渐渐消失……无时无刻都在修炼,一不小心无敌了,我收神兽当坐骑,纳人妖魔族圣女作小妾,独创宗门——神帝宗主宰世界,好不容易脱离了宗门,可一不小心又回到了这个地狱,当了那么多年宗主,殊不知本宗门女弟子那么多还美,没办法,神帝宗,老子又回来了我叫伏庆,我穿越了,成了一把剑的剑灵。 好在觉醒了签到系统,每天签到就能变强。 我的本命剑修是个腹黑的小丫头,每天拼命修炼提升境界。 别的剑灵都在疯狂讨好主人,我才懒得搭理她。 一心只想打盹睡觉,签到变强。 观天行,识阴阳,纳五行,万化生乎身,守本性。虽历经万难亦不忘福泽一方。且观天珩烟雨,守己之心,从容而行。虽然南宫基的成长有点慢,但这些都是他必须有的经历,要不如何能在各种经历和磨难中成长,又如何超脱,各位看官请耐心与南宫少爷一起经历,让经历成为财富,成功就在不远的地方等着你。 他闭上了现世的眼睛,在来世睁开,是否能看透黑暗的迷雾,不在异域迷失自己? 他穿越到火山魔法学院,一个穷困潦倒,没有攻击技能的废物身上,无意间的一个举动,得到了一只智商很高,能跟人沟通的猎犬。 在它的帮助下,得到法宝恶魔心索,成为了各大势力竞相收买的红人。 俗话说的好,花无白日红,人无千日好,正当他即将步入人生巅峰的时候,意外出现了…… 十字路口,他将何去何从?王一乐看完博人之后,愤怒地大吼道:“你们这后传写得是什么破玩意?老子随便扔块零摄氏度以下的水都能燃气来!” 最后越想越气的王一乐打穿了他的电脑显示器,结果连带着他接驳过的220v电源线也被扯断了。 王一乐,卒,享年25岁。 与此同时,木叶忍者村一乐面馆里,一位27岁左右的大叔从棺材里突然坐起,这一幕吓坏了木叶众人。 从那天以后,王一乐就在木叶村安居下来,开始了他的保姆生涯。鲜血淋漓的战场,神秘的第三方势力,未完待续的故事…… 意外穿越进游戏世界的楚昱和盛追,在诧异和激动下开启了他们的游戏人生。 在不断和域界人洛羽的相处下,他们逐渐发现了这个世界里和游戏的不同之处,剧情中的漏洞究竟是bug还是阴谋? 友情、立场。 信仰的冲突下,他们的冒险究竟会如何发展呢。意外闯入修仙世界,穿越成为筑基失败仙路断绝的修士,还好师傅是大佬,师兄师姐也不凡,本以为就此混吃等死,得过且过。但是老天爷不愿意啊!(老天爷;你一个穿越者还想安生,造作起来吧宝贝!)
狗狼 界脉天 超能玉石 共同走向世界之巅 西游开局天庭签到十万年 百花大帝 剑灭王朝 洪荒:人间儒圣,口诛笔伐惊天地 朕要君临天下 从星河开始 圣灵之魄 三国之无双帝皇系统 枕中一梦 少年的喜欢 从梦想之城到第一超时空 元灵法则 特区枭雄 歧途:葬欢 兴安岭日记一卷 狐妖小红娘: 签到生活 2000年猴年邮票价格 中国梅花邮票 邮票2016-15 邮票价格查询 2O15-2 2000年猴年邮票价格 南昌邮票公司 90周年邮票发行量 中国银行猴年纪念邮票 濮阳邮票多少 西厢记型张邮票 918邮票 918邮票 j169邮票的来由 建行猴年金邮票 1996年红旗轿车邮票 邮票行情列支敦士登 邮票1964 90周年邮票发行量 濮阳邮票多少 澳门银行邮票价格表 82猴邮票价格 中国梅花邮票 重大事件发行哪些邮票 2017邮票整顿最新消息 82年8分邮票价格 中国银行猴年纪念邮票 j169邮票的来由 濮阳邮票多少 2017邮票整顿最新消息 澳门银行邮票价格表 濮阳邮票多少 邮票价格查询 2O15-2 中国梅花邮票 台湾古代钱币邮票 82猴邮票价格 j169邮票的来由 邮票行情列支敦士登 邮票1964 2001兰花邮票市场价格 90周年邮票发行量 j169邮票的来由 2001兰花邮票市场价格 邮票行情列支敦士登 邮票1964 世界第一枚国旗邮票 方寸邮票也能体现一个国家 彩灯邮票图片 82年8分邮票价格 中国梅花邮票 918邮票 台湾古代钱币邮票 清代/蟠龙邮票 96年生肖邮票多少钱 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 封神天决 诡事慢谈 异世手记 腾云驾雾天使之吻 布局百年徒弟请我出山! 皇冠登3出租 澳门葡京游戏官网 澳门葡京官网 皇冠登3出租 亚星官网 邮票价格查询 2O15-2 建行猴年金邮票 j169邮票的来由 1996年红旗轿车邮票 方寸邮票也能体现一个国家 西厢记型张邮票 中国梅花邮票 西厢记型张邮票 2017邮票整顿最新消息 2000年猴年邮票价格 西厢记型张邮票 邮票行情列支敦士登 邮票1964 2000年猴年邮票价格 2000年奥运邮票价格 南昌邮票公司 彩灯邮票图片 邮票2016-15 清代/蟠龙邮票 青贵邮票交易 建行猴年金邮票 中国梅花邮票 82猴邮票价格 2017年凤文物邮票图片 濮阳邮票多少 重大事件发行哪些邮票 台湾古代钱币邮票 重大事件发行哪些邮票 96年生肖邮票多少钱 2001兰花邮票市场价格 邮票价格查询 2O15-2