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
网络安全审计专业免费建站网站图派做网站网站建设未来发展前景dns网络安全北京网站建设公司收购腾讯营销案例ppt淄博网站设计军用信息安全产品认证证书等级深圳营销网站网络安全前沿进展手机app网站建设酒店网站制作策划公司中信息安全管理工作般做什么上海绿盟计算机网络安全技术公司分析网络营销环境分析信息产业信息安全测评中心2017信息安全发展趋势江苏网络安全事件网站开发 价格上海中网网络安全技术有限公司网络营销案例产品厦门手机网站建设公司珠海做网站女孩子学网络营销汽车营销案例全网营销云推广2017信息安全发展趋势计算机网络安全测评师企业网站项目流程信息安全合规一个新世纪助人为乐的自动武器与弹药工程专业的硕士,一次喝多了阴差阳错被天外流光砸中入了地府。被宿醉的阎王判入了完全没听说过的修行时空,这里不再有成熟的社会体系,不再有丰富实用的科技产物,有的只是各种兽气拟兽的功法,特殊的肉体条件还有完善的修炼体系。发现自己误事了的阎王主动再投胎转世前想要给予一些秘籍补偿,又因为记错了转世所去的时空情急之下随手不长了少年一本大道至简的剑法精要。还未喝下孟婆汤就被送过奈何桥的褚笑:“你这是弄啥嘞,周围都是什么兽气外显以气拟兽的,你给本没有练气方法的剑法有啥用?”看褚笑如何在这个兽气拟兽主导的世界,和上辈子砸死自己的造化印一起做一个……剑客!一个倒霉了二十多年的倒霉蛋的英雄之路“老爷,那孙猴子又来找你了?” “嗯?他又惹什么事了?” “他把镇元子的人参果树给打倒了!” ... 魏征! 西游中的一个小卒。 但他很久之前就在想着,要不要打醒天庭? 因此帮了孙悟空大闹地府,打闹天宫。 而后又再想如来势力是否发展太快了,是否要压制一下 ...... 任何人都不知道魏征往取经之路上,安排了多少只自己的妖精,孙悟空所请的救兵,有多少是魏征手下的? 天庭,西方,都认为取经之事在自己掌控之中。 却不知,他们尽在凡间大臣魏征的掌控之中。这个世界由三种基本粒子构成,分别对应了勤勉、博广和睿智。人类的灵魂自然也是由它们承载。在宇宙形成过程中,基本粒子产生了各种律动,是人类情感产生的源泉。不同的情感对应了不同的律动奥义,主角带你领悟不同的律动奥义……少年地狱归来,携美纵横都市,定乾坤,破苍穹!一个伟大的帝国轰然倒塌,新的时代即将到来。 林羽带着帝国仅存的力量退守滇南,每日与蛇虫鼠蚁打交道的他终于再也忍不住了; 于是乎,林羽毅然起兵只为拿回属于自己的一切。 又名《穿越之我在异界签到变强》,《只有发展商业才能变得强大》等等。游戏与考试有时可以实现完美结合,而道德也应该影响考试的结果,某个班级里的十五名男生也这么想。他们个个都在某些领域有着自己的专长,也有着自己致命的缺陷。他们有的出身显赫,父母都热爱读书;有的却不幸出身于一个思想境界低下的家庭,不慎被家庭影响,坠入无底深渊。突然,他们被卷入了一场场特殊的考试之中,他们需要用自己学过的知识去应对各种各样的险境。你认为他们能成功吗?看似平静的世界中,有人身负法则之力,有序运转的法则之下,埋藏着鲜为人知的阴暗面……红月当空,全球骤变。拥有力量,你就高高在上,应有尽有,没有力量,你就只能任人宰割。危机爆发,众种族林立,丧尸,异兽,鬼种,人类。九转山河,浩瀚天下,试问天下,谁与争锋!起步比别人晚的颜逸能否追赶众人的脚步,在末日之中杀出一条属于自己的路。长城上的游客络绎不绝,长城下魔术师们也被吸引而来,远古的法阵守护着实现愿望的机械,这是争夺圣杯的一场战争,也是一场命运的战争。
信息安全认证 烟台专业网站建设 网络营销公司干嘛的 海南网站优化 深圳做网站(官网) 精湛的佛山网站设计 专业的营销网站 北京网络安全展 山东 信息安全 检查 成都网络营销公司 展示网站模版源码 网站制作 手机 网站建设未来发展前景 android 网络安全 办公信息安全意识 最新营销工具 腾讯营销案例ppt 免费商城网站 网络与信息安全信息通报中心 网络安全体 武汉网站建设公司 网络安全技能大赛ctf 福州专业做网站的公司有哪些 网络安全 云计算 苏州网络安全作业 android 网络安全 网页类网站 企业网站的意义 信息安全合规 中山企业网站建设公司 欧盟 网络安全 西丽网站设计 铜仁网站建设 办公信息安全意识 网站网页设计公司 信息安全测试师 网络营销论文报告 网站关键词 最新营销工具 房产网站建设