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
女幽灵 百度网盘下载 迅雷下载南京文交所钱币邮票交易中心邮票交易所十二生肖邮票邮票市场奥运邮票女幽灵 百度网盘下载 迅雷下载世界上第一枚邮票中国邮票鸡年邮票白氏夫妇的离奇死亡引来江湖上二十余年的争斗不休,逃出生天却散落各地的白氏三兄弟,将要如何解开父母被害的谜团,他们到底是江湖上人人钦佩的有德之士,还是人人得以诛之的欺世盗名之徒,迷雾一层又一层,父母,兄弟,爱人,师长,义父,每一个人都有自己的秘密,每一个人都与三兄弟纠葛不清,江湖之大,三兄弟该何去何从……九龙大陆,强者为尊,武道一途,与天争命,且看一朝皇子,凭三尺长剑,如何皇临天下!武道巅峰,谁为皇? 为了心中的一丝执念,阳炎勤修武,争太子,夺皇位,战天下,历生死,证武道,破轮回! 号令天下,莫敢不从!无敌天骄, 神魔血脉, 吾持一剑,碾天骄,镇神魔, 一剑碎山河,破九天,通万古…… 来自数百年后的特种兵王,穿越成为和自己名字同音的晚明皇帝天启身上。 狙建奴,收日韩,木匠皇帝?不,工匠皇帝!大国工业自明而始! 铁血皇明,平推世界!天地间有气运万千,每个人生来都背负着属于自己的气运,当一些人不满足于自身的气运之时,争运者便诞生了......穿越成了朱元璋的孙子,朱允熥头大了。 他只想躺平,躲得远远的做个逍遥小地主,却没想所有人都以为他在演戏! 朱元璋:这孩子一无是处,可咱家怎么越看越喜欢? 朱允炆:我去!原来这小子一直在坑我! 朱棣:别装了,老子早就看穿你了! 朱允熥:??? 都特么有病吧? 爆笑大明,个个都是脑补高手,原来还可以这样当上皇帝! 我是一只哈士奇,一只英文名叫dog,中文名叫道格的哈士奇。 作为一只会说人话的狗,我的压力很大,保不住哪天就被抓走切片了。 而现在,我的铲屎官居然把我丢给了一个叫单小飞的宅男,自己逍遥快活了。 在和单小飞生活的日子里,我真是受尽了苦痛折磨。但是也经历了许许多多有趣的事情。初创的雷皇朝里妖物横行,刚刚建立的仙警局要面对各种妖魔鬼怪.....他,本是被世界所抛弃的人, 一个可怜的孩子。 他,不甘命运,走向复仇之路。 “我为君王,令天下为臣子!” 即便流干最后一滴血, 他也未曾放弃。 天公无德,玩味世人。 复仇之旅,我欲逆天。 凶案连连发生,旷世绝学现世,原始森林险地,让不平静的江南,更是杀气满天。
女幽灵 百度网盘下载 迅雷下载 中国邮票价格表 上海邮票网 中国邮票价格表 大龙邮票 邮票市场 中国邮票 大龙邮票 邮票市场 第三轮生肖邮票 第三轮生肖邮票 邮票收藏价格表 邮票收藏 南京文交所钱币邮票交易中心 鸡年邮票 邮票市场 奥运邮票 邮票收藏 邮票图片 邮票价格 邮票图片 生肖邮票 十二生肖邮票 邮票价格 文革邮票 十二生肖邮票 文革邮票 生肖邮票 中国邮票价格表 邮票互动网 猴年邮票 民居邮票 龙邮票 邮票收藏价格表 女幽灵 百度网盘下载 迅雷下载 邮票网 邮票互动网 猴年邮票 邮票图片 邮票网 不死树之阿巫冷宫拔剑三百年,我成了绝世剑仙人与机器人的末日之战守望者:规则篇都市重生之剑仙归来重生,校园时代都市修仙:怕鬼狂少登仙录不太正经的明日方舟诡秘游戏:开局获得德古拉血灵!不是一般的校园修仙黄昏诸神说网游之天命大法师灵异:黑暗最深处女总裁的神医兵王远古尸毒灵魂交易管美人小村医封神:请尽情吩咐妲己无序者乱世豪杰传奇海阳市度假区房价请复制到浏览器打开 威海二手房 阳光林森家具 萨米特厂家 克劳迪卫浴 按摩椅价格 铜陵租房价 水波帘头的怎么重合 怎么拆衣柜 实木家具图片 丹东小区 如何洗马桶 欧式沙发坐垫套1 2 4 双色水波裁剪方法 窗帘的单位 普雅小区 珠海二手房 成都搬家公司电话 厦门家具厂 桂花价格 自动立体仓库设计 软件 唱经楼小区 鲁灰石材厂家 浴室柜网 联邦家具官网 衣柜 机器封边 胶 环保 衣柜功能 伊思特衣柜 深圳明宏家居翻新沙发怎么样 杭州市半道 红二手房房价 2016 衣柜 减压阀价格 自打浴室柜 包覆厂家 石家庄搬家公司的电话号码 青岛市搬家公司电话号码 沙发批发布艺沙发行情 爽洁康马桶 石家庄搬家公司电话 变频器价格 吉斯沙发 板房厂家 镂空水波的制作方法 苏州家具 圣象衣柜 湖北 新中式浴室柜批发 窗帘水波种类 座试马桶 呼和浩特博爱小区总高层 石材价格 金华衣柜 怎么用马桶 紫色水波窗帘效果图 定制衣柜 品牌 KTV沙发 金刚门厂家 彩钢板价格表 整体橱柜衣柜加盟 型材价格 进门见衣柜 济南燕山小区 窗帘图片网 衣柜百叶推拉门 山东自动化立体仓库哪家好 塑木地板厂家 货架展会 钢窗料厂家 窗帘进货 仓库组成 向欧卫浴 鸿陶马桶 汉口白金领域房价 中国十大卫浴 投光灯价格 石家庄浴室柜生产厂家 上海金山房价 红樱桃房间门 配什么颜色衣柜 消费主张 衣柜 窗帘水波有几种 丽江房价 成都二手房 空调移机价格 上海2014年 施工临时房价格应该按多少来计算 定制衣柜的价格 粉煤灰价格 半自动仓库 世界上第一个立体仓库出现在 好莱客衣柜怎么样 滑动门厂家 马桶评测 武汉中型货架 厂家沙发批发 窗帘行情 北京货架子 风水 客厅 衣柜 凤凰居小区 增城搬家公司电话号码 宜家沙发 气味 臻品 衣柜 南海搬家公司 黄石房价 柏西衣柜