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
女孩侧脸高清头像唯美图片小清新花卉头像男生头像坐在地上背影最火qq头像小孩子萌情侣二次元带字图片霸气头像女孩侧脸高清头像唯美图片萌小孩情侣清晰头像男生头像坐在地上背影惊艳头像图新浪微博欧美情侣头像好看的带字情侣头像两张男生头像坐在地上背影男眼镜人头像女生彩虹头像图片超高冷头像 女生新浪微博欧美情侣头像唯美闺蜜头像一对卡通黑暗头像女卡通黑暗头像女卡通头像中国龙动漫图片大全yy头像在线制作不闪的黑暗头像女卡通惊艳头像图情侣动漫头像带字最新版本二次元带字图片霸气头像好看的女闺蜜头像漫画可爱女孩qq头像卡通情侣动漫头像带字最新版本头像中国龙动漫图片大全男眼镜人头像青国大元帅:两国交战不斩来使,除非来的是金小宝。 皇圣祖:只要金小宝愿意,我的公主随他挑。 一品太傅:岂有此理,金小宝你别落我手里。 瑶池圣女:金小宝给我滚出来,你躲得了初一,躲不过十五! 二表姐:金小宝,你别躲,我就跺你一根手指头。 月女将军:金小宝,我这三千手下,随时可以为你上刀山下火海。让我毁灭这一切后才发现,原来是我误会了这一切,我该如何挽回这一切。末日降临,生化危机,丧尸出笼,世界末日到来!   楚源获得模拟器功能,开始模拟存活时间。   【第一天,灾难降临,丧尸出笼,世界末日到了!】   【第二天:你喝着小酒吃着火锅!】   【第三天:你打开门走出去,一只丧尸与你热情相拥,你白给了!】   楚源:“系统,让我多存活几天!” “有请我的世界个人pk赛冠军陆瑜先生上台领奖!” “有请我的世界跑酷竞速赛冠军,陆瑜先生上台领奖。” “有请起床战争总局赛FMVP选手,陆瑜先生上台领奖!” “有请我的世界红石挑战赛冠军,陆瑜先生上台领奖!”  …… 陆瑜:“能不能给我搬一把椅子上来,领个奖跑上跑下怪累的。” “对了,麻烦再给我准备一辆货车 ,我怕奖杯太多,待会带不走。” “谢谢,有请下一位嘉宾给我颁奖。” “你小子莫装逼!装逼可是要……” 轰隆隆—— 全能玩家陆瑜被雷劈死后,竟然转生成方块大陆的村民。 还是个傻子! 幸好,游戏的Minecraft的系统还在,成为傻子村民陆瑜从零开始方块大陆的生活。 【恭喜解锁一键砍树MOD!】 【恭喜解锁食物工艺MOD!】 【恭喜解锁拔刀剑MOD!】 “陆瑜,你怎么做到的?” “阿巴阿巴阿巴。” 陆瑜不知道,不关陆瑜的事儿。作品没有合适的分类,主要还是属于哲学小说。 如果有兴趣,请直接进入正书,谢谢各位对我爱好的支持!曾经是地球上普通的社畜,回首往昔,皆因九星揽胜 遭雷劈,至古星,宇宙边野,只求在当世混个名头 被迫踏祭坛,走人族古路,梦想位居帝位,与诸多同道,只为争仙 什么世人崇拜的仙魔,不过是些苟延残喘虚伪无情的垃圾 而今我独断仙道,只求杀尽天上仙! 看我从红尘中来,打碎这冰冷的天!五年前,叶尘被暗害沉江,侥幸不死,穿越到其他位面,医武双修,达到巅峰之时重归都市,却发现自己有了女儿,但女儿却患了先天心脏病,妻子姜若雪也被抓走,叶尘怒了。他一怒,血流成海,江河撼动,让天地都为之变色。分手的那一刻,我手里有了一个亿,成为亿万少女的梦。穿越洪荒百万年,还是玄仙修为   林长青绝望之际,师尊通天赐予九转金丹   没想到,竟然觉醒诸天赠送系统!   赠送九转金丹,返还百亿功德!   赠送通天剑符,返还神象镇狱劲!   赠送黄中李,返还混沌灵根!   赠送盘古精血,返还……   林长青行走洪荒,赠送无数宝物,杀妖,屠魔,救人族!   终于,当量劫降临之时,林长青一人横立量劫之前,挥手扫灭无边劫云!大唐,狄汉卿夙夜忧思的母国! 长安,狄汉卿魂牵梦萦之地! 高宗年间,二圣临朝之时,长安却接二连三地出现离奇罪案,死者死状诡异恐怖,民间一时谣言四起,传闻妖魔作乱。 武后传旨,让镇妖司十日内迅速破案,以安民心。 然十日期限将至,案件仍无进展,毫无头绪! 一时之间武后震怒,民心惶惶! 狄汉卿,值此之际,来到风云诡谲的长安,专司此件离奇罪案··· 然而妖魔易除,人心难辨, 狄汉卿发现案件背后,与二圣临朝有着千丝万缕的联系,因而陷入一场惊天阴谋当中··· 不过,也因这桩奇案,让狄汉卿的命运从此和长安紧紧牵连在了一起! 数年后,大唐国运呈崩天之势,乾坤易转,妖魔四起,狄汉卿又将如何斩妖除魔,且看长安斩妖实录···
梵天君临 废柴的科技飞升 千变修罗 全球御兽:开局契约一只鬼 请别对鬼下手 黄土地里的七杀命格 紫月录 三国:开局被曹操封护国瑞兽 那小师叔真帅 修真小捕快 我重生为汉献帝了! 枪挑万古之无脖传 乡村小术士 云上有长生 野火一卷 都市风流小仙医 我真的不是无敌的 全职法师中的悠闲生活 地球特攻队 燃道 酷酷微信网名和头像大全 手绘治愈系情侣头像 唯美闺蜜头像一对卡通 二次元带字图片霸气头像 酷酷微信网名和头像大全 可爱胡子头像怎么画 唯美闺蜜头像一对卡通 女头像抱可爱猫 好看的女闺蜜头像漫画 情侣头像动漫黑白伤感 惊艳头像图 大笑女生头像高清 复古霸气意境头像女生 手绘治愈系情侣头像 女孩侧脸高清头像唯美图片 二次元带字图片霸气头像 头像 微信 霸气女英国 好看的女闺蜜头像漫画 qq头像背包baqi 男生头像坐在地上背影 手绘治愈系情侣头像 超高冷头像 女生 小清新花卉头像 女生彩虹头像图片 新浪微博欧美情侣头像 复古霸气意境头像女生 好看的女闺蜜头像漫画 小清新花卉头像 qq头像背包baqi 好看的女闺蜜头像漫画 二次元带字图片霸气头像 好看的带字情侣头像两张 最火qq头像小孩子萌情侣 女孩侧脸高清头像唯美图片 情侣动漫头像带字最新版本 二次元带字图片霸气头像 最火qq头像小孩子萌情侣 唯美闺蜜头像一对卡通 复古霸气意境头像女生 超高冷头像 女生 可爱女孩qq头像卡通 情侣头像动漫黑白伤感 320x320吉他男生头像 头像 微信 霸气女英国 女生彩虹头像图片 手绘治愈系情侣头像 大笑女生头像高清 可爱女孩qq头像卡通 复古霸气意境头像女生 萌小孩情侣清晰头像 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 江湖分两半 书剑传奇录 苍灵神尊 小老虎大冒险 寻仙之引 澳门葡京官网 AG真人 快连下载 澳门葡京官网 欧博游戏官网 好看的女闺蜜头像漫画 复古霸气意境头像女生 二次元带字图片霸气头像 头像中国龙动漫图片大全 可爱胡子头像怎么画 女孩侧脸高清头像唯美图片 头像 微信 霸气女英国 女头像抱可爱猫 大笑女生头像高清 超高冷头像 女生 320x320吉他男生头像 最火qq头像小孩子萌情侣 女头像抱可爱猫 二次元带字图片霸气头像 最火qq头像小孩子萌情侣 好看的女闺蜜头像漫画 可爱女孩qq头像卡通 女生彩虹头像图片 萌小孩情侣清晰头像 好看的带字情侣头像两张 二次元带字图片霸气头像 新浪微博欧美情侣头像 复古霸气意境头像女生 320x320吉他男生头像 头像中国龙动漫图片大全 情侣头像动漫黑白伤感 手绘治愈系情侣头像 男眼镜人头像 qq头像背包baqi 酷酷微信网名和头像大全