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
脱贫攻坚的论文题目网络语言暴力英语论文脱贫攻坚论文参考文献外国论文哪里找外国论文需要翻墙么脱贫攻坚的论文题目尾气检测的毕业论文脱贫攻坚论文参考文献文化方面毛概论文维普网怎么发表论文维普论文程序代码查重脱贫攻坚的论文题目唯物辩证法相关论文维普论文程序代码查重脱贫攻坚论文参考文献维普网怎么发表论文未来的城市论文1500字维护自己的权益议论文维护自己的权益议论文脱贫的形式与政策论文网络语言暴力论文结尾维护自己的权益议论文文化的历史发展的影响论文2000字网络技术发展史论文外国论文需要翻墙么王子复仇记英文版论文外国论文哪里找网红营销 论文网络技术与安全论文唯物辩证法相关论文穿越到异界获得了表便光鲜实则苦逼的身份,在死后重生后还是没有逃过····雇佣兵李怀心因为一场意外穿越到了一千年前的隋朝末年,成为冤死的隋朝四大名将贺若弼的私生子贺若怀心,身负前世今生之恨,开始了一段传奇的铁血之旅。 横刀所指,狼骑所向,皆是汉家天下!逗比男主欢乐多,沙雕伙伴凑一窝,热血什么的完全不存在,苟才是王道失忆的少年,醒来后唯一所拥有的只有身边的一把黑剑。他渴望回忆起自己的记忆,机缘之下,少年救下了一名美丽的少女,少女作为回报愿意无条件的收留并帮助他寻回记忆,从此以后,少年以一名学生的身份重新开始生活。命运的齿轮同时开始旋转,不断回忆起来的记忆碎片,为何都与千年前的魔王有关呢?一个个的邪星士,一个个的记忆碎片,在记忆的碎片面前,他会做出如何的抉择呢?他最后的愿望,又会带领这个世界走向怎样的尽头呢?身陷囹圄,陆抗得天魔本源相助,逃出生天。 没有灵根,陆抗以血祭之法强行开辟,从此修行得道。 修行魔道,却不为恶,妄称正义之辈莫坏我自在逍遥。 偶行善事,自诩邪恶之徒莫言我虚假仁义,阻我大道朝天!【莫轻烟我爱你用尽了最后一丝力气对着一个貌美的女子说道】 偏爱都市爽文的顾辰 正在美滋滋的看着小说 江辰:不是我说,这个反派也太傻了吧 亏我还跟他同一个名字 谁知道下一秒江辰被传送到了 这本书的boss 面对反派无脑挑屑 惨遭主角打脸的狗血桥段 顾辰应该怎么面对 顾辰一脸懵逼的躺在10米的豪华大床上 【滴!反派系统已绑定】 顾辰也是淡定了下来 系统在手 第一女主未婚妻 将军爷爷 商界大亨父亲 京都第一世家长子 这个身份! 江辰忽然感觉 当一个大反派也不错!我是一只哈士奇,一只英文名叫dog,中文名叫道格的哈士奇。 作为一只会说人话的狗,我的压力很大,保不住哪天就被抓走切片了。 而现在,我的铲屎官居然把我丢给了一个叫单小飞的宅男,自己逍遥快活了。 在和单小飞生活的日子里,我真是受尽了苦痛折磨。但是也经历了许许多多有趣的事情。 江湖远而乱朝堂 纷乱的时代刚刚结束,混乱却纷涌而至。 是拥兵自重,还是自立为王? 是冠绝天下,还是一统江山? 庙堂之上人心叵测。 江湖深远杂乱险要。 君若不弃,还请拭目以待。 且看琅琊成名时! 无上大地破晓陨落他重生到圣后国毫无修为的圣女小姐身上後会发生什麽? 毫无修为的圣女小姐皇权被架空。意外开启圣女系统。 什么我重生竟然变成女的。幸好我有系统。 系统说别得意本系统是不会帮助你的,你还得靠你自己。 坑啊!变成女的就算了给个只能看不能用的系统。那我要你这系统何用。 系统:呵呵只是我觉得你不配拥有本系统。 滚你丫的系统。 就算没有功法没有修为又如何。我定要逆他这个破天。 没有任何金手指在这个以武为尊的世界,何去何从? 且看废物圣女如何震撼天下,开辟出一条逆天之路。 穆曦辰生在一个世家大族,但在一个夜晚,他所在的家族和族人被某个势力所灭,他和妹妹侥幸逃跑,在深山之中被一位神秘强者收为门徒······ 他们能否找到灭族真凶,为族人报仇呢?
天生王侯 十四载烽火狼烟 山海烟尘 异世界众横 小农民阿斗 幻灵:我是全球最强 传播文化十五年,我成帝了 末日求生之我没有挂 天庭小灵官 匆匆17年 地狱领主:我兵种无限升级 天国战纪四风之传奇 江南的自我养成 萬象之主 熊孩子:咦,当官真有意思 异世界神探 乱世虎将 我摊牌了 谷情封夕 我与怪族之间的故事 网络语言弊议论文800 维普论文检测怎么打印 未来的城市论文1500字 维护自己的权益议论文 网络语言弊议论文800 网贷进校园有有关论文 尾气检测毕业论文 维普中收录的硕士论文 王子复仇记英文版论文 唯物辩证法相关论文 文化的历史发展的影响论文2000字 文化的历史发展的影响论文2000字 网络技术发展史论文 维普网怎么发表论文 脱贫攻坚的论文 外国论文需要翻墙么 尾气检测毕业论文 王子复仇记英文版论文 网络语言暴力论文结尾 脱贫攻坚的论文题目 维普论文检测怎么打印 脱贫攻坚论文参考文献 网络语言暴力英语论文 维普论文表格查重 维普中收录的硕士论文 网络技术发展史论文 王子复仇记英文版论文 网络语言暴力英语论文 网络语言暴力论文结尾 王子复仇记英文版论文 维护自己的权益议论文 维普论文检测怎么打印 外国论文哪里找 脱贫攻坚的论文题目 网络技术发展史论文 外国论文需要翻墙么 妥协 论文 尾气检测毕业论文 网络技术发展史论文 妥协 论文 外国论文需要翻墙么 维普中收录的硕士论文吗 脱贫的形式与政策论文 文化的历史发展的影响论文 维普论文表格查重 维普论文检测怎么打印 文化的历史发展的影响论文2000字 外国论文哪里找 网络技术与安全论文 尾气检测的毕业论文 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 恶之渊 黎明之末世纪元 天堑之轮回间 末世蜕变者 网游之恩怨几长 葡京官网 快连下载 欧博官网 葡京官网 欧博官网 尾气检测的毕业论文 尾气检测毕业论文 未来的城市论文1500字 维普论文程序代码查重 网络技术发展史论文 脱贫攻坚的论文题目 维普论文检测怎么打印 维普中收录的硕士论文 维普论文检测怎么打印 网络语言弊议论文800 维普网怎么发表论文 唯物发展观论文 网络语言暴力论文结尾 维护自己的权益议论文 妥协 论文 未来的城市论文1500字 网贷进校园有有关论文 网络技术与安全论文 网络技术发展史论文 文化的历史发展的影响论文2000字 维普论文表格查重 维普中收录的硕士论文 网络技术与安全论文 网络语言暴力论文结尾 文化的历史发展的影响论文2000字 妥协 论文 网络语言暴力论文结尾 王子复仇记英文版论文 脱贫攻坚的论文题目 王子复仇记英文版论文