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
邮票价格第三轮生肖邮票大龙邮票中国邮票价格表邮票邮票交易所邮票价格邮票交易所邮票收藏十二生肖邮票魂,乃人之始。 内魂,乃人之本。 一切以魂而生,一切以魂而死。 究竟是奋起直追,还是自甘堕落。 内魂,方可掌控乾坤! 刚穿越成蜀山剑派大师兄,就因为勾结邪魔教妖女,被废去修为,剥夺身份,羁押在锁妖塔! 好在绝望之际,楚风获得神级签到系统! 在锁妖塔前签到,奖励剑体之首,【无始剑体】! 在三皇殿签到,奖励【轩辕剑】! 在三清殿签到,奖励【紫金红葫芦】! …… 楚风本着不无敌,不轻易出山的想法,苟在蜀山默默签到! 但当三千年前的绝世邪魔,邪剑仙率众攻上蜀山剑派时! 楚风挺身而出,负手而立,横剑身前! “前方蜀山,妖魔禁行!” 灵气复苏,大争之世,万世未有之变局将临,三段投影,一生传奇,礼赞人族,壮哉华夏。 丧尸突然在校园出现,校园只剩二百多名同学包括四个校花,我们的主角苏长影会怎么做呢?他会拿下四个校花冲出校园,过上神仙般的生活吗?三年前,大婚之日,他遭人暗算,被人投江。   三年后,他脱胎换骨,再临故地。   这一次。   他绝不会再让任何人主宰自己的命运.....healer国际一级犯罪心理学专家和17岁被怨少女水晶清纯未婚妻,腹黑小姨子,性感女刺客都别来找我啦!我还得努力修仙呢!全球异变,每个人都有属于自己的武魂,除了宁凡。 “废掉武魂跟我学修仙吧,修仙更有前途。”宁凡真诚的看着众人。 同学:“老师,宁凡疯了!送医院吧。” 爸爸:“我的好大儿,爹不嫌弃你没武魂,但是你别疯啊!” 陌生人:“喂?精神病院吗?你家病人跑出来了,赶紧来接回去。” 狗:“汪汪汪~”尘寰外,碧海中,桃花之间桃花岛。秋风起,海波兴,几度潮来听玉箫。且看东邪黄药师传人,如何纵横都市。满天神佛朝我跪拜,天下美女唯我独揽!已完本,放心阅读。上古圣战,天现裂象,神州大地分崩离析,无数碎片散落宇宙化作万千小世界。 数百万年后,一名渔村少年意外踏上修仙路,是机缘巧合还是命运使然? 在这个神魔并立,人妖共存的世界,且看他如何一路披荆斩棘,步步飞升。
生肖邮票 邮票收藏 邮票收藏价格表 邮票图片 鸡年邮票 邮票价格 邮票 邮票价格 第三轮生肖邮票 纪念邮票 鸡年邮票 猴年邮票 女幽灵 百度网盘下载 迅雷下载 龙邮票 十二生肖邮票 欧美群迅雷下载 邮票交易所 女幽灵 百度网盘下载 迅雷下载 南京文交所钱币邮票交易中心 邮票收藏价格表 南京文交所钱币邮票交易中心 上海邮票网 中国邮票价格表 邮票收藏价格表 民居邮票 中国邮票价格表 猴年邮票 上海邮票网 邮票收藏 中国邮票 邮票图片 邮票 奥运邮票 猴年邮票 邮票价格 邮票收藏价格表 大龙邮票 邮票图片 南京文交所钱币邮票交易中心 邮票收藏价格表 对话日常震惊!开局校花给我生了三胞胎一气化神玄天劫录圣龙图腾超级惊悚直播之命笔噩梦重启小岛:螳螂效应由懵懂到憧憬在末日中生存我有一剑冲星河造神局轩辕招魂西游:这条龙有点不一样大燕出家人盗迷之八子连珠冰尘决太空人冒险日记盖世师姐汉汉庐江二手房请复制到浏览器打开 定制衣柜 弥勒 新阳上城二手房价格 独山子小区 仓库有类别 二七区搬家公司 小区诊所图 酒店套房家具 赛陶卫浴 衣柜 防虫剂 各类货架 窗帘 布带 浴室柜的选材 欧式沙发图片134套方案 装修效果 货架批发 手工砖厂家 义乌 衣柜 细木工板价格 佛山市货架 货架衣服 锐全卫浴 沙发制作 专卖浴室柜 窗帘垂线 厚壁管厂家 马桶分体式 黄州房价 樱桃树价格 杭州三里亭一手房 房价 客厅沙发1 2 3位怎么摆 楸木家具的优缺点 大东区万泉搬家公司 望牛墩四季华庭房价 仓库式小型超市图片欣赏 做窗帘水波 河西二手房 花格 厂家 深圳汇龙苑门面房价 白色墙 衣柜颜色 顶秀美泉小镇房价 卡茜卫浴 水平仪价格 红木家具 策划 上海产马桶 木浴室柜 简单镂空水波的裁剪图 上海家具公司 新乡搬家公司 乳浊剂价格 大朗搬家公司 宿迁二手房 龙圩龙湖春天小区楼盘 田园小区 马桶单档 卫生间衣柜 浴室柜洗脸盆安装说明 箭牌马桶怎么样 汇丰凯苑最新房价 创佳卫浴 比瑞浴室柜 信瑶家沙发 店 西安凤城明珠小区咋样 北京木樨地的房价 推土机厂家 养生壶价格 书橱衣柜 纸板价格 广州货架展柜厂 蝴蝶绿厂家 北京房山窦店沁馥家园房价 佛山浴室柜厂 上海居民搬家公司电话号码 黄连木价格 北京北京鹤鸣搬家货运公司电话 电水壶价格 广州天河人人搬屋电话 西安轻质隔墙板厂家 内蒙古家具 附近搬家公司的电话号码 卫浴招聘网 窗帘的市场 朝阳浴室柜价格表 窗帘投标 泰州人的衣柜工厂 惠达卫浴价格 南通光明西村房价 通辽二手房 洗脸盆价格 拉格格实木多层板衣柜怎么样 山东壁纸厂家 多层小区全方位 家具造型的基本元素及形式美法则 北新桥搬家公司电话 心海伽蓝1.2米浴室柜 办公家具 价格 房山二手房 马桶品牌排名 红霞园艺社区房价 藤沙发 紫砂壶价格 张家港二手房 塑胶地板生产厂家