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
网络安全工程培训深圳网站建设公司招聘电话销售事件营销要素2016网络安全重大事件做一个营销型网站电脑网络安全培训台州网站建设公司天津微网站信息安全提供商信息安全合规性互联网信息安全公司排名河南网络安全易营销软件代理商富阳市网站求职网络营销公司网络安全性评估周期网站建设我们的优势饿了么营销信息安全电脑推荐免费的网站申请网络安全认证协议外贸视频营销电商与微营销东莞网站设计公司全网营销 执行系统网站辅导运营与托管公司网络营销问题汇总大网站成本网络安全 思科 中国网站要多钱十年前,滨海第一大家族林家一夜之间被灭族,唯一幸存者林玄被一路追杀,所幸危急时刻被一个小女孩救下,北上逃难。 十年后,林玄成为一代王者,但却在加冕当天卸下王冠,回到滨海......公元2020年,一场陨石雨降临蓝星,随后爆发了大范围的丧尸病毒。 全球百分之九十的人口感染了病毒变成了丧尸,幸存下来的人们撤离到了被高墙围起来的城镇内。 穿越而来的赵日天,在一场魂力考核现场获得了终极魔典系统,可以继承所有英雄的终极技能。 赵信的新月护卫、永恩的封尘绝念斩、亚索的狂风绝息斩...... 最终,赵日天凭借系统,在丧尸围城的世界里,一路上所向披靡。荒凉和野兽纵横,机遇与至宝并存;这是最好的时代,也是最坏的时代。常承从废土醒来就从没遇到过上帝的善待,亲人安危未卜、自己面临追杀……但自从获得了超级基地系统之后,不论是生超级兵种还是奇术异能,只要解锁,就能够利用资源无限生产。什么?你有一条超凡路径,不好意思,理论上我的超凡路径是无限的,而且,超凡强者我甚至可以批量生产!这是一个无限生产力推动探索无尽时空尽头真实存在的故事。一个人如果能够回到过去,他的人生是否会发生变化,答案或许是肯定的!那么他是否也能够改变他人的命运呢,如果也是,那么又能改变多少呢?叶荇的这个故事就从回到过去开始......我们登上并非我们所选择的舞台,演出并非我们所演出的剧本。猎人与猎物的身份发生了变换,原有的社会体系遭受冲击。世界不复太平,战争变得随处可见。 “我只想活下去,让身边的人活得好一点。”林奕由衷祈愿。荒凉的街道,坍圮的建筑,蒙入尘埃的城市,人类遭遇着前所未有的危机。是自然的选择,还是人为的灾难?这是神魔意志与人类精神的碰撞,这是斗气与魔法充斥的世界,在牧师的祈祷与召唤师的吟唱中,天才少年龙行云带领渺小的人类,决战诸天神魔。他是骑士?他是魔法师?他是学霸?他是冒险者?他是英勇的领主?他是伟大的统帅?他是无敌的战神?不他是人类的英雄。一位家境贫寒的少年,经历了常人难以想象的苦难,磨砻砥砺,奋发向上。好不容易华丽转身,完成了人生意义上的大逆袭,一时平步青云,风光无限! 这期间,少年也先后得到了好几位绮年玉貌少女的青睐,演绎出许许多多荡气回肠,缠绵悱恻的爱情故事。其中的情与理,是与非,仇恨与挚爱,痛苦与欢乐,人性与心魔,交互编织成一道道直逼心灵拷问的风景,让人热血沸腾又扼腕长叹!刑警队长罗生与歹徒双双坠楼身亡,妻女重伤难治。雷电交加的暗夜里,巨大的紫黑色的手掌将罗生拽进一个光怪陆离的修仙世界。 丧失前世记忆再世为人的罗生降生于六国雄立的无尽疆土,成为秦国中州一世家的嫡长孙“罗睺”。拥有爷爷与母亲的疼爱,父亲与师傅的严厉,罗睺是所有人的骄傲! 然而,当他失去这一切的时候······当他被命运中那只巨手扼住未来的时候,他能做什么? 削此轮回永恒族大能者操纵着棋局变幻,道盟,帝君,仙域之主彼此制衡,无法齐心, 无数生灵存活于仙灵庇护下,成为仙人创造的附庸,傀儡,多少追逐长生,名利,权力的天才死在贪婪之路上! 与群仙称雄,与群魔征战,三千小世界,十万大世界。 “一世命既万世命!” 罗睺昂首穹苍,坐在那孤独的三界之主的王座上,他的手上沾满鲜血,灵魂中的每一个毛孔都是死去对手的脸! “我可以选择放弃杀戮,但是那样会让更多的人死去。” “残忍,不是掌权者的专利!” 【圣女+无敌+御兽】 重生后的叶天,发现自己竟然成了魔教圣女手中的傀儡教主。 不甘命运的他却意外觉醒无敌神威系统,从此翻身为王,开启牛哔的开挂人生。 穿越第一天,神功速成,统御万兽! 穿越第二天,横扫八荒,力压诸天! 穿越第三天,夜晚,圣女找上门……
违反计算机信息安全条例 财务软件信息安全 做网站百度 网络营销战略 案例分析 上海网站开发制作 东莞网站设计公司 事件营销要素 口碑营销案例 东莞网站建设服务公司 网络安全大会2017ppt 中国互联网络安全2017信息安全 新闻 个人备案 可以做企业网站吗 杭州 信息安全厂商 杭州全网营销 做网站百度 国家信息安全等级 网络营销问题汇总 网络营销策略模式 信息安全高级专员 网络营销基础知识学习 房产类网站制作商 北京市信息安全产业基地 网站字体 全网营销 执行系统 黑龙江信息安全测评中心 魔兽信息安全 营销道理 营销服务专家 rsa信息安全大会 2017 天津 网站设计公司 饿了么营销 营销道理 网站优化课程 北京市信息安全产业基地 b北京网站建设 网络营销基本模式 html5 网站 信息安全云服务平台 互联网信息安全公司排名 论坛发帖推广营销服务