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
鸡年邮票邮票价格十二生肖邮票邮票图片纪念邮票鸡年邮票鸡年邮票上海邮票网邮票行情民居邮票在这片神州大陆上,分布着五个帝国,修罗帝国位居其中,每一位修罗想要变强就要在大陆各处辛苦历练,历尽磨难不断的提升自己,从而晋升修罗真魂魂力等级,获得相应的修罗封号,然而修罗神神祇只要一个人能晋升成功,让我开启全新的修罗世界吧。少年李苏牧,自北地持剑而出。 为寻身世之谜,一人一剑,乱北荒,踏北洲,横渡冥海;闯东洲,撼东荒,决战天幕山。人类起源永远是个猜想,或者我这个猜想才是真正的样子。这本书描述了一位创世者如何创世并见证了地球人类的发展。通过他的见证,让我们更多的了解哲学,或者说了解天道天理。故事发生在上古神魔大战之后,一场长达五年的战争,因接引佛祖的死亡而起 玉帝通缉余靍而生……意外穿越,自带外挂? 弱肉强食,适者生存? 修仙世界就没有人权? 看周奇如何在天玄大陆混的风生水起。 若无法,我来定。 若无正义,我来伸张。 若无将来,我来探寻。 帝令一出,万族臣服,莫敢不从…… 五代十国,乱世风云,后周显德年间,佛劫降世,佛门高僧入世消劫,引发了诸多江湖儿女的家国情仇,为天下太平演绎岀荡气回肠的传奇故事……   寂寂夜空孤月寒,十七年离别茫茫。一念执真,南风绿依,盛颜银发证衷肠。   最是有情“负情蛊”,三年生离道心初。剑啸弦荡,逍遥慕云,一念倾情一生终。   啸引苍波,漫卷山河,心志难酬朱颜改。孤情骄阳,若玉独镜,小楼空照人何在?   日月无改江山裂,金戈铁马雁泣血。渊鱼更龙,世宗执戟,风起云涌荡山岳……   一缕清风,人间太平吹拂……"三阴绝脉"者,史书所载;凡患此症者非但终生不能修武,并且几乎无一人能侥幸活过十三岁。命运关上所有的幸运之门,却开了一扇窗,令其在绝境中峰回路转,当其踏着尸山血海攀上巅峰之时,骇然发现一个惊天之秘。暮然回首,惊觉自己脚下的这片世界幌若恒河之沙粒,渺若微尘。何去何从……罗月松率特战分队,远赴滇缅战场,成为戴安澜将军200师侦察尖兵,探路先锋,深入丛林,战端重开。变成鬼后,我才发现有一只无形的收推动着整个世界一颗天外陨石突然降落地球,地球迎来了最终篇章。 地球盖上了一层抓不透的红色纱布,这颗陨石到底是什么? 饥饿,伤痛,恐惧,死亡,恐惧萦绕在人们头顶。 审判,是末日最终的工具。
民居邮票 邮票收藏 大龙邮票 文革邮票 邮票互动网 世界上第一枚邮票 民居邮票 龙邮票 奥运邮票 女幽灵 百度网盘下载 迅雷下载 文革邮票 中国邮票 第三轮生肖邮票 邮票网 猴年邮票 纪念邮票 上海邮票网 龙邮票 女幽灵 百度网盘下载 迅雷下载 邮票互动网 女幽灵 百度网盘下载 迅雷下载 大龙邮票 邮票 邮票互动网 中国邮票价格表 邮票 中国邮票 大龙邮票 南京文交所钱币邮票交易中心 邮票吧 邮票收藏 纪念邮票 生肖邮票 中国邮票 世界上第一枚邮票 邮票交易所 邮票吧 邮票收藏 女幽灵 百度网盘下载 迅雷下载 邮票交易所 星际穿越之外星文明侠客仗剑守国门柒夜百物语玄幻:每天一种神级天赋晦暗师途弑爱如归了然若流玄神之上末世之神级暗影系统全球入梦医圣下山:开局打脸未婚妻!蛮荒第一狂徒灵异复苏:从单挑阿飘开始师叔亿点强,师侄们全是气运之子!灵气时代,我能复制武魂鬼卫记小说版后周帝国花满惊鸿,人去空留蓝星天虎3090年的血腥风雨西宁二手房请复制到浏览器打开 衣柜里有樟脑丸 怎么办 杭州萧山瓜沥蓝色家园房价 将家桥小区 货架型仓库 合肥肥西搬家公司 广源a小区 临汾二手房 长沙市望城区搬家公司 马桶高度 钢木门价格 惠州江北24号小区规划 唐山四通搬家公司电话号码 大衣柜裤架 柏士壁厂家 60墙挂浴室柜 马桶浴室柜 长沙专业整体衣柜定制加工 浴室柜特点 衣柜 液晶屏价格 北京房价网 沂水沂水房价走势 中式家具 蚂蚁搬家官方客服电话 纵向水波帘头裁剪 衢州小区 青岛小区 整体窗帘 沈阳仓库笼 仓库货叠高 红光银丰园二手房房价 水波制作视频 新昌房价高 通州区搬家公司电话 窗帘花型 衣柜拉手 一般多大 圣马利卫浴 唐人街家具 木沙发 古典家具网站 旋转衣柜 沙井搬家电话 南京仓库货架 二手办公家具 惠达牌马桶 临潼区搬家公司电话 pvc厂家 大丰二手房 小水泵厂家 自贡市宏发小区图片 湖北货架 富之岛沙发 2匹空调价格 武汉东风小区房价 白石桥附近搬家公司电话 花岗岩石材价格 唐山搬家公司电话 洗浴沙发 low-e玻璃价格 南京二手房365 光触媒价格 滨江花园房价 欧派橱柜 衣柜 墙面浴室柜 铝合金防盗窗价格 典木浴室柜 锦绣年华小区 顶固衣柜2016年年会在哪里召开 北京有几家搬家公司 高压锅价格 西樵窗帘 青岛的搬家公司 窗帘搭配 广州黄埔中信搬家公司电话号码 卧室的窗帘 恒洁卫浴马桶图片 惠州 劳卡衣柜 领尚窗帘 朝阳区 酒仙桥 房价 长石粉厂家 中山仓库 全友家私家具价格 窗帘水波花头怎么做 深圳商超货架 卡芬不锈钢浴室柜 浪皇卫浴 广州二手房出售 镂空水波制作视频 福安香樟苑房价 西安复试房价 铜钱价格表 易施美价格 武汉仓库货架 黄龙玉手镯价格 名洁马桶 灞桥区小区 郑州翰林世家小区 顺丽漆价格 宝山搬家公司叫车电话号码 远离市区小区门面经营什么好 衣柜种类