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小时,不给予办理投胎业务。 而我当了十八年的鬼,终于等来家里给我烧了一间小卖部。 我意外发现这件小卖部通阳间,可以从阳间进货,拿到阴间来卖。 从此以后我便就做起了阴阳两界的生意,叱咤阴间。 和乔老爷一起卖手机,和扣比一起打篮球,但阎王竟然不要我投胎?现代科技盛行的时代,神异力量复苏。 正义与黑暗的抉择,科技与神异者的斗争正式打响。 这个世界谁对谁错,需要新的法则来制衡。 这是一个灵师横行的世界,鬼怪只能在夹缝的挣扎。而主角莫北开局身为一只实力低微的游魂,如何在被各路灵师追着砍中求生,并在危机四伏的神秘世界成为一代鬼中至尊。一段七代传承中医人的故事,一首普通人的悲欢喜乐我叫白凌云,当我睁开眼时,我发现我竟然穿越了。 这里有武者,有魔法,有修仙,有忍术,有异能…… 在这里,武者是最卑微的存在,武已经没落了…… 而我,刚穿越就面临一个很严重的问题…… 谁能给我一碗馄饨面呀!我都快饿死了!姓白,名日梦。 某网站最拿不出手的小说作者,每码一百字就想做梦,一天下来整不出一章。 每日做梦次数最高记录两千次。 月薪百万,宝马女神,环游世界; 拳揍钢铁侠,脚踢迪迦; 带猴哥重闹天宫,血虐西天如来; 重生尹志平,打败杨过和小龙女双宿双栖; 收服食铁兽,征伐世界; 神佛妖魔皆向我臣服,地球没有我就不能转…… 然而,这一切终归虚空,码字还得继续,菜鸟作者何时能彻底清醒,不再为梦所累?主角:林轩 时间:2021年,宇宙外的地球的平行空间 背景:该地球上的古修仙者,欲打破天之规则,在冲击天幕的时候,导致天之痕的出现........但之后被其封印天之痕(遮掩痕迹), 但破碎的规则碎片流入时间长河,落入一孕妇体内..........后穿越者夜皇穿越天之痕是不小心毁去封印,但封印不仅是对天之痕的封印还有对未知的 天之痕外域外生物的遮蔽,封印的解除导致域外生物的入侵,而其中的智慧生物更是危险至极,身为天则碎片的的林轩必将快速成长,再次封印 天之痕,但域外的生物,以及渴望长生的古猎人会对林轩也必将有一激斗...........
邮票价格 邮票价格 邮票交易所 中国邮票 上海邮票网 奥运邮票 香港回归纪念邮票 邮票收藏 世界上第一枚邮票 纪念邮票 文革邮票 纪念邮票 大龙邮票 上海邮票网 纪念邮票 第三轮生肖邮票 上海邮票网 世界上第一枚邮票 文革邮票 生肖邮票 纪念邮票 邮票市场 邮票吧 邮票收藏价格表 猴年邮票 奥运邮票 生肖邮票 上海邮票网 大龙邮票 邮票收藏价格表 第三轮生肖邮票 邮票收藏 民居邮票 邮票交易所 民居邮票 邮票图片 文革邮票 猴年邮票 猴年邮票 大龙邮票 洪荒之梦回古灵帝君爽!时空淘宝让我成为人皇第一纨绔:我爹陪我穿古代妖神笔录小道游人间梦醒始黑白城之六城废墟我的美食帝国缆镇的龙套有志者事必成之凤栖梧桐缚神凌仙苦海无人间灵玄传那年江湖那些事无敌从进入梦境开始造化魔神系统奇志录,戮神空间途录高房价还能撑多久请复制到浏览器打开 led灯价格 梦天木门价格 电商仓库货架摆放 西安家具卖场 昆明西山区搬家电话 立体自动化仓库英文 浴室柜型号3021 窗帘店射灯 浴室柜厂 大衣柜家具 深圳货架网 窗帘水波太下 康雅卫浴 马桶主页 水族箱价格 海沧二手房 嘉园附近搬家公司 马桶怎么清洗 气泵价格 公兴搬家电话 深圳罗湖搬家公司 西安大型仓库 海南文昌房价 那个生产工厂为全球消费者提供批量藤家具藤沙发藤椅藤摇椅藤吊篮 割草机价格 九牧牧马桶 马桶不进水 衣柜里有樟脑丸 怎么办 卫浴品管 乌鲁木齐浴室柜批发 王庄仓库 东莞仓库货架批发市场 买二手房贷款 上乘深圳龙岗搬家公司 水波帘有那几种款式 铸管价格 楼梯的价格 南阳雪枫大桥附近房价 马桶盖尺寸 金华衣柜店 卫浴配件 塔院小区 停车收费 圆钢价格 诺维家整体衣柜 西安西郊搬家电话 工具货架 电脑桌价格 宜家 沙发椅 细木工板价格 窗帘布工厂 水波弧形工字帘头 惠阳二手房 不锈钢水塔价格 衣柜 承重设计 衣柜橱柜定制 病房门厂家 和陶马桶 实木厂家 3T马桶 广东立体仓库货架 帘头新款式水波20i7年 马桶截气阀 米兰沙发图片+价格 低端卫浴 12门abs全塑更衣柜 恒洁卫浴官网 房价网 吸塑衣柜门 环保吗 缝纫机价格 济南二手房房价 西宁蚂蚁搬家联系电话 青岛搬家公司地址 窗帘店加盟 怎样注册搬家公司 窗帘布工厂 吊柜衣柜 大涌刺猬紫檀沙发销售厂家 腻子粉价格 联邦高登衣柜 搬家公司费用 马桶怎么拆 松岗搬家电话多少 厦门办公沙发订做哪家好 唯卫马桶 水波窗帘曼头价格 窗帘水波幔子制作 衣柜 白色的好吗 石家庄家具厂 桑拿衣柜 走入柜木质 名品卫浴 浴室柜板材 吉斯 沙发 静电 滁州来安有哪些小区? 青岛金水路房价疯了 石膏板厂家 容桂二手房 信宜衣柜 地毯价格 货架厂北京 铝轮厂家 电动窗帘应用