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
电视剧里面叫长栓的文姗姗肖明电视剧宣萱和胡杏儿演的电视剧神墓改编电视剧电视剧花姑子异史氏电视剧里面叫长栓的2013年的乡村电视剧有哪些电视剧宣萱和胡杏儿演的电视剧任昌丁主演的电视剧电视剧渴望剧照图片一部老婆出轨的电视剧全集电视剧里面叫长栓的贵州电视台电视剧一部老婆出轨的电视剧全集宣萱和胡杏儿演的电视剧电视剧渴望剧照图片2011年董洁主演的电视剧有哪些高拱电视剧高拱电视剧巫刚主演的电视剧市长战昆仑电视剧的演员表浪花一朵电视剧视频励志电视剧下载西葳秘密电视剧电视剧花姑子异史氏有一个韩国电视剧穿越火线神墓改编电视剧杨紫琼电视剧全集国语巫刚主演的电视剧市长贵州电视台电视剧陈家是东北一个普通的农村家庭,改革开放前生活困苦,看不到希望,后乘着改革开放的春风,陈家生活逐渐富足,一家人也收获了爱情和幸福生活,富裕后的陈家人开始想着帮助相亲致富,在遭遇挫折之后,陈家新一代掌舵人开始更大的计划,想改变他所生活并热爱的那片黑土地! 前世,杨羽自暴自弃,整天鬼混,导致妻子女儿惨死眼前。   今生,杨羽仙帝归来。   有仇报仇,有怨报怨,守护妻女,所向披靡! 主角房齐天是个刚高考完的学生,在接受了大学毕业后准备和同学们一起去游玩的留学生——表哥余秋明的邀请后来到了富家子弟的私人飞机上。飞机在空中飞行时进了一个虫洞,是穿越?还是穿越到古代?落地后发现这是一个名为“瑞”的朝代。 房齐天的名字变成了花零,并且在经历了许多事后被告知这是上古时代。还说希望文明回到正轨就要牺牲一个人并接受诅咒,让文明全部毁灭,这太荒谬了。花零最终完成了这些“神”给予她的“任务”,文明消散后花零在这个时空的家庭也不复存在,所有人都会忘记花零。 ——神明那所谓的诅咒就是:永生不死。 永生后的花零目睹了所有朝代的兴旺衰败,目睹了国家与国家之前的勾心斗角,历史的兴旺衰败花零都看下来了。 但是花零的永生可是被杀被碎尸万段都能够无限复活的永生,当然不止能看那五千年……如果当知道自己穿越了,接下来你会做什么? 胡吃海喝,装比打脸? 刻苦训练,称霸天下? 不不不,首先你得先赚钱吃饭,然后洗个澡让自己欧气满满。 至少铁公鸡李长生是这样想的,他小小年纪便领悟到人间真谛:对钱,他不感兴趣(凡尔赛本赛)。 李长生背着天球精灵,脚踏万里河山,苍生剑一剑问天。 问长生为何苦恼,叹系统不让白嫖。天道不公,我便逆天  李暮穿梭了异界,穿梭到一修仙天地,变成一个采矿的奴隶。跟他来的,有一灵塔。但是整体天地也变更了。......一位非流派宗派的修仙者,一不同的修仙天地。一言定生死,一语变乾坤。苏凉穿越到玄幻世界,从此所到之处,鸡犬不宁 追瘸子骂哑巴,打疯子逗傻子,扒老太太裤衩子 无恶不作 仙界大能:他竟然把我镇宗功法印了整整十万份! 宗门少主:苏凉竟然把我活活搞成肾虚! 仙门圣子:欺人太甚!竟然把我与一头猪牵了本命姻缘线!害我爱上了一头猪! 天才圣女:谁看见他把我衣服偷到哪里去了? …… 这一次苏凉从大佬手里抢亲 彻底引爆了所有人对他的怒火2320年,人类的足迹已经步满太阳系周边的星系,科技迅速发展。令人意外的是,人类没有发现任何有文明的星球。迅速膨胀的人类开始内战,一个名为陆南的运输舰长,在内战时误入虫洞,在一个荒芜的星系,和两个敌人一起开启新的人类文明。少年苏渊经历三次凝丹失败,机缘巧合拜四圣兽之一的青龙为师,踏入武道之途,并且开启自身龙族和凤族血脉,从此天高海阔,前途无量。 探索秘境,结天骄,诛邪魔。
凶宅试睡师 彼岸落笔 重生之无敌盗墓 穿越之我有修仙系统 末世血魔王 都市之我被迫成神 从秀才到高僧 长生记:轮回之界 末世神魔录 穿越风云之谍海岁月 火箭队干部晋升日记 奴隶少年与傲娇公主那些事 我将人生作游戏 溯源仙迹 帝国雪绒花 皇朝争霸,建造最强神朝 我在东京经营宠物店 猎灵士 霜寒相伴 异世重生:秩序崩坏 我们的幸福生活电视剧 电视剧代号34百度网盘 2011年董洁主演的电视剧有哪些 高拱电视剧 我们的幸福生活电视剧 70年的电视剧 中国虐心电视剧 织田信长 电视剧 有一个韩国电视剧穿越火线 贵州电视台电视剧 励志电视剧下载 励志电视剧下载 西葳秘密电视剧 电视剧渴望剧照图片 电视剧致终将逝去的青春 电视剧花姑子异史氏 中国虐心电视剧 有一个韩国电视剧穿越火线 战昆仑电视剧的演员表 电视剧里面叫长栓的 电视剧代号34百度网盘 宣萱和胡杏儿演的电视剧 文姗姗肖明电视剧 浪花一朵电视剧视频 织田信长 电视剧 西葳秘密电视剧 有一个韩国电视剧穿越火线 文姗姗肖明电视剧 战昆仑电视剧的演员表 有一个韩国电视剧穿越火线 高拱电视剧 电视剧代号34百度网盘 神墓改编电视剧 电视剧里面叫长栓的 西葳秘密电视剧 电视剧花姑子异史氏 不懂女人电视剧国语71 中国虐心电视剧 西葳秘密电视剧 不懂女人电视剧国语71 电视剧花姑子异史氏 美国看中国电视剧 巫刚主演的电视剧市长 潜水艇的电视剧 浪花一朵电视剧视频 电视剧代号34百度网盘 励志电视剧下载 神墓改编电视剧 我的老爸是奇葩电视剧全集 2013年的乡村电视剧有哪些电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 我在聊天群扮演异火炎帝 混世小公主的绝代软饭王 超品鉴宝师 红知了 她与罪同行 AG真人 亚星管理平台 亚星游戏官网 AG真人 百家乐官网 电视剧致终将逝去的青春 任昌丁主演的电视剧 电视剧花姑子异史氏 杨紫琼电视剧全集国语 美国看中国电视剧 美国看中国电视剧 巫刚主演的电视剧市长 电视剧致终将逝去的青春 70年的电视剧 电视剧花姑子异史氏 电视剧里面叫长栓的 织田信长 电视剧 2011年董洁主演的电视剧有哪些 西葳秘密电视剧 不懂女人电视剧国语71 校花的贴身高手电视剧林逸 巫刚主演的电视剧市长 励志电视剧下载 西葳秘密电视剧 杨紫琼电视剧全集国语 美国看中国电视剧 美国看中国电视剧 我的老爸是奇葩电视剧全集 巫刚主演的电视剧市长 70年的电视剧 不懂女人电视剧国语71 浪花一朵电视剧视频 电视剧代号34百度网盘 校花的贴身高手电视剧林逸 70年的电视剧