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
荆门鑫达驾校预约电话甘肃驾校预约考试网站荆门鑫达驾校怎么样驾校结业证明怎么开驾校科目二预约考试网站登陆荆门鑫达驾校预约电话湖北大学驾校收费荆门鑫达驾校怎么样河北驾校规则江苏省驾校考试预约驾校约考是不是考试荆门鑫达驾校怎么样货运资格证要去驾校培训吗?驾校约考是不是考试驾校报名协议书样板江苏省驾校考试预约湖南交通驾校官网驾校学车的最新情况。驾校科目二预约考试网站登陆连云港驾校预约河北驾校新规定驾校学车的最新情况。河北驾校规则丽水驾校官网驾校结业证是什么样辽宁驾校考试预约入口驾校结业证是什么样丽水驾校官网连云港驾校预约济南驾校考试新规定穿越修仙世界的林浩,成为天罡阁阁主的天才儿子。 开局被废掉修为关入魔窟,幸好觉醒签到系统。 只要在特定地点签到,便能够获得丰厚奖励。 “叮,签到成功,获得星辰丹田海!” “叮,签到成功,获得星辰剑!” “叮,签到成功,获得九龙宝珠!” 数年后,当林浩踏出魔窟,发现自己已经举世无双,可是,修仙却是一个骗局。近未来的某一天,一款划时代的虚拟网游问世,在人们狂热的追捧下,几乎所有人都沉迷在游戏里不可自拔,其影响力更是有影响现实社会的趋势,然而就是在这样娱乐至死的环境里,未知的危险亦悄然降临,让全人类都面临灭亡的危机,其背后埋藏万年的秘密也随之逐渐浮出水面。简介:本该人生平平无为的主角,从一个性格柔弱到脱变成刚毅的成长故事,后来主角从这跌宕起伏的生涯中成就无上荣耀。世纪系统,一个控制无数世界的完全潜行程序。由自称先驱者的神庭议会所创造,用于控制宇宙间物质与能量的转化。被称为天父的男人是议会中最不合群的一个,但掌握了更多的系统权限与绝密资料。天父创造了十二个维护者用于协助自己对世纪系统进行相应的修复与优化,其中最后诞生的维护者不像其哥哥姐姐,仅由编号来命名他,似乎是为了躲避某种系统机制。虚数空间对现象世界进行侵入时展现出世纪系统的弊端,大量的错误信息覆写了大量的命运模块数据。世界陷入混乱。天父遇刺死于系统大厅,指挥十二维护者的重任压在长子——普罗米修斯身上。大部分的维护者都被派往虚数空间镇压混乱,直到连长子也被虚数空间混乱的能量所侵蚀陷入癫狂,最终被十二封印在第一宇宙世界。十二对神庭议会进行了大清洗,铲除内奸,尝试独自修复这个已经癫狂的世界,强制将系统进化成新的形态。“让你买丹药回来,你却成为了丹药师?” “让你请医师回来,你却成为了医师?” “让你去买大宝剑,你却成为了炼器师?” “出远门咋这么快回来了?啥?你成为了驯兽师?骑霹雳飞龙回来的?” “去趟淘宝馆,你咋淘回了这么多极品宝贝?啥?你又成了鉴定师?” “不好!赘婿中毒了!快……不用了,没事了,他又成为了毒师。” 易尘抱头,没办法,系统太强悍了!在封建王朝翻云覆雨的伟大人物,竟是一个名不见经传的小卒。“三更堂?阎王让你三更死,谁敢留你到五更的三更堂?” 胖哥,先为不可胜呀,算无遗策呀,智珠在握呀。被打的吐血还在这装? 兄弟二人,美女撑腰,携酒上吟亭,满目江山列画屏。叶帆重生在元宇宙刚刚开始的时候。 没有人比他更加清楚元宇宙到底是一个什么样的东西。 这是一个地球文明与高级文明联网的时代。 这是一个地球变异、人类接受各种全新科技、基因突变、生命进化的时代。 这是一个充满了机遇与挑战的时代。 前世的叶帆只能仰望强者,在卑微中走向死亡。 这一世,叶帆要向生命的终极进化迈进!中医专业文。 在另外时空的一颗蓝星,大战后的数百年里,并没有多少的战争炮火,需抵御的,唯有疾病、动物与复杂的自然环境。 在这医疗知识缺乏的世界,一位年轻的小伙子,从水中被救了出来...... 观千年文化,叹博大精深,以故事之形,解日常之需。 ——本作品以异界古代的方式,文章内容以教徒为主,章末传递日常中医知识。 杨涛是一个天才高中生,他能否顺利杀入NBA呢?
魔主在校园 开局选了恐龙族 我家娘子竟是妖族女帝 云山迷情 旅程:我在各世界旅游 导线 我独仙行 星际元帅在七零 神奇宝贝之开局无敌 我是一个兵之兵之路 都成圣主了,让我回地球? 九天神帝 元:师 星神战天记 浩瀚大世界 开始工业革命,才知道是仙武大秦 异时空的拯救 枯门戏子 重生赎罪,回到妻离子散之前 浮生鬼道 辽宁驾校几点考试时间 江苏省驾校考试官网 湖南交通驾校官网 驾校科目二预约考试网站登陆 甘肃驾校预约考试网站 兰州驾校 驾校收“熟悉场地费 湖南交通驾校官网 淮阳技工驾校怎么样 辽宁驾校考试预约入口 货运资格证要去驾校培训吗? 东莞驾校考从业资格证 东莞驾校考从业资格证 连云港驾校考试时间 江苏省驾校考试官网 荆门鑫达驾校预约电话 驾校科目二预约考试网站登陆 登封少林驾校校长电话 辽宁驾校几点考试时间 河南驾校教练需要什么条件怎么报名?需要什么费用/ 荆门鑫达驾校怎么样 江苏省驾校考试官网 荆门鑫达驾校怎么样 河南驾校教练需要什么条件怎么报名?需要什么费用/ 驾校学车的最新情况。 江苏省驾校考试预约 连云港驾校考试时间 辽宁驾校几点考试时间 甘肃驾校预约考试网站 河南驾校教练需要什么条件怎么报名?需要什么费用/ 辽宁驾校考试预约入口 驾校科目二预约考试网站登陆 建中驾校怎么走 驾校结业证明怎么开 荆门鑫达驾校预约电话 丽水驾校官网 驾校结业证是什么样 驾校结业证明怎么开 湖南交通驾校官网 丽水驾校官网 驾校报名协议书样板 驾校结业证是什么样 淮阳技工驾校怎么样 涟水炎黄驾校学费多少 登封少林驾校校长电话 驾校约考是不是考试 建中驾校怎么走 东莞驾校考从业资格证 驾校结业证是什么样 连云港驾校考试时间 湖北省学车b照驾校。 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 天灵环 狙杀成塔 末世之陆 王之路! 黑马荣耀 欧博游戏官网 皇冠登3出租 亚星管理平台 欧博游戏官网 亚星管理平台 荆门鑫达驾校预约电话 涟水炎黄驾校学费多少 河南驾校教练需要什么条件怎么报名?需要什么费用/ 江苏省驾校考试预约 湖北大学驾校收费 荆门鑫达驾校预约电话 辽宁驾校考试预约入口 甘肃驾校预约考试网站 驾校科目二预约考试网站登陆 辽宁驾校几点考试时间 连云港驾校考试时间 驾校结业证是什么样 连云港驾校考试时间 湖南交通驾校官网 涟水炎黄驾校学费多少 建中驾校怎么走 淮阳技工驾校怎么样 江苏省驾校考试官网 驾校报名协议书样板 河北驾校新规定 驾校报名协议书样板 淮阳技工驾校怎么样 驾校结业证是什么样 驾校报名协议书样板 湖南交通驾校官网 驾校结业证是什么样 驾校约考是不是考试 湖北大学驾校收费 驾校约考是不是考试 连云港驾校考试时间