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
邮票价格香港回归纪念邮票奥运邮票邮票图片香港回归纪念邮票女幽灵 百度网盘下载 迅雷下载邮票收藏价格表鸡年邮票上海邮票网邮票收藏价格表我们的人生究竟是自己主宰着还是被所谓的因果推动的不断前行 我叫罗威,能力是个只会吐槽的旁白,体质是能够使接近我的美少女提升实力。   本来以为这将会是一个美少女找我贴贴的故事,但不曾想有人另辟蹊径——   原来想杀我也算是和我有亲密关系的吗!!?欲望与愿望,仇恨与守护...... 名为“奇迹”的力量往往需要付出代价 这是关于少年北星河,不堪忍受命运的安排,通过“奇迹”逆天改命的故事。 废柴?退婚?绑定作死系统?作死就能变强? 叶天尘:想当年作死的过程多么快乐,可是一晃眼…… 轰隆隆!(仙帝法决袭来) 叶天尘:还是那么快乐! 只要杀不死我,我就能变强在热度不弱于沙漠的荒野之地上,一道人影显得和这个世界格格不入。狂风吹动沙尘,遮蔽了其外貌,只能若隐若现的看到,人影的个头并不高。   他受伤了,而且还是很重的伤势,身上全是鲜血,已然干涩。这些鲜血,有些是他的,有些,则不是。   随着漫天的黄沙有了消散的迹象。他的外貌,也随之逐渐显示出来。男主为了解开家族秘密,独自前往异世界,便开始了属于自己的阴阳师道路,期间男主结识各路英雄好汉,不断提升自己的咒术,最后解开家族的秘密。末日来袭,地球上的植物与水源全部枯竭衰败。 世界陷入恐慌,秩序与人性崩碎。 食物与生存,再次成为新世纪之后人们最关心的话题。 米面成为奢侈品,唯有富豪才能享用,菜蔬更是身价暴涨万倍,有价无市! 然而就在此时,有人捡到了一部手机,偶然打开之后,手机内的视频令世界震惊。 甘甜的菜蔬滚入火锅之中,散发着诱人的绿色! 烤的金黄的羊腿滋滋冒油,沾上芝麻般的孜然! 鲜美的鱼汤炖的宛若牛奶一般纯白,撒上翠绿的葱花! 饭桌旁,一名粉雕玉琢的小女孩咬掉半颗草莓,哀求道:哥,我真的吃不下了!! 所谓神明,不过是蛰伏在暗影之处的小偷! 他们需要称颂,他们需要信仰,他们需要祭祀,他们需要血肉。 他们自称给予你所想要的一切,在你耳边低声呓语!江山如画,美人妆! 龙腾万里,乐逍遥! 一个穿越者的灵魂; 一个当代皇者之命魂; 一个身负上天之意的天女; 当三者相辅相成,为天下先,为苍生意。 匡扶社稷,历经磨难。 是宿命的轮回还是这悠悠天意,人力难为; 朝堂,战场,血雨厮杀,阴谋密布; 烽烟过后,张翼回首看向背后孤寂的威威皇朝,看着曾经的硝烟之处,却早已物是人非。 上马提剑定天下,下马安国保苍生。 ps:慢热,有逻辑,不属于小白文,慎重选择。世界大变,神界,魔界,妖界,鬼界,反正各种各样乱七八糟的世界全被打开,人类孱弱,为了,为了避免地球灭亡,地球之灵选择人族杨大力建立地灵街……
猴年邮票 十二生肖邮票 邮票价格 生肖邮票 奥运邮票 邮票行情 大龙邮票 邮票行情 女幽灵 百度网盘下载 迅雷下载 文革邮票 欧美群迅雷下载 香港回归纪念邮票 猴年邮票 邮票行情 女幽灵 百度网盘下载 迅雷下载 生肖邮票 民居邮票 南京文交所钱币邮票交易中心 世界上第一枚邮票 文革邮票 奥运邮票 邮票网 鸡年邮票 大龙邮票 邮票 中国邮票价格表 邮票市场 中国邮票价格表 欧美群迅雷下载 邮票互动网 民居邮票 邮票行情 奥运邮票 邮票收藏价格表 龙邮票 香港回归纪念邮票 世界上第一枚邮票 大龙邮票 邮票图片 十二生肖邮票 我和鬼的故事光与暗之绝代天骄我在仙界有个爹命运魔神的创界之旅十方境灭本宫要修仙诡医谜案以凡入道决凡人觅仙长生无道濒临毁灭,在末世拯救世界诸天副本:开局就是无敌潜力求仙入世铁血青州鬼差日常混世不乱纵星者念武记少年的喜欢时空尽頭多控开关价格请复制到浏览器打开 金镶玉价格 复合地板厂家 秦皇岛搬家公司电话 水波幔的计算方法 日生卫浴 上海小货车搬家电话 实木床价格 欧式沙发35套方案 装修效果图 装 宝山路小区 水波幔头的裁剪方法 思迈尔卫浴 整体衣柜 五金的选择 液晶屏价格 丽都大厦房价多少 小窗帘店 大众搬家电话号码 凯美乐不锈钢浴室柜官网 清漆价格 汉中小区 合肥衣柜厂 英石厂家 搬家公司规定 绍兴二手房 卡西尼卫浴 水波窗幔用料 复兴村小区怎么走 武邑县小区 窗帘遮阳 美立方小区 梅州小区 浴室柜选什么牌子的好吗 窗帘荷叶边 溧水二手房 深圳有什么好的搬家公司 公兴电话 房价收入比怎么算 上海到焦作物流沙发多少钱 重叠式水波幔 趟门衣柜 淋浴花洒价格 玻璃釉马桶 在福州倌尾街买旧房价格多少? 衣柜 业务 马赛克厂家 地图鱼价格 一鸣宽房价 廊坊小区 农联房价 雅安小区 红木家具论坛 衣柜图片大全 效果 整体衣柜安装 窗帘水波帘头计算价格 窗帘行业 科艺里房价 窗水波尺 哈尔滨嵩山小区物业 防城港二手房 上海房价走势 房价税费 西安最新房价 精品沙发垫 小区诊所图 龙骨石价格 阳光花园小区 樱桃木地板价格 宁波搬家公司电话号码 济南齐鲁花园小区房子怎么样 整体衣柜柜门 南京衣柜 九牧卫浴旗舰店 坐墩马桶 佛山浴室柜生产集中地 法恩莎马桶价格 新乡浴室柜 明清家具 中国房价暴跌已悄然开始 河北仿实木铝合金浴室柜厂家直销 复合地板价格 水波窗幔效果图 房价税费 怎样的水波窗帘 电焊机价格 品卫不锈钢浴室柜 太原新友谊小区 方太整体厨房价格 龙头厂家 不锈钢玻璃门价格 衣柜拉条 模具厂仓库职责内容 精品超市货架 人人总部电话 地板砖做浴室柜 具人同行家具平台 防城港二手房 特瓷卫马桶 马桶主页 广州大众搬家公司咨询 青岛家具市场 佛山衣柜厂 帘头做什么水波好看