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 in Bootstrap utilizes 12 columns that render out at widths of 724px, 940px (default without responsive CSS included), and 1170px. Below 767px viewports, the columns become fluid and stack vertically.

<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

p>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="span6">
        Level 1 column
        <div class="row">
            <div class="span3">Level 2</div>
            <div class="span3">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>

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>

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: 767px) { ... }
  /* Portrait tablet to landscape and desktop */
  @media (min-width: 768px) and (max-width: 979px) { ... }
  /* 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 hiding 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
网络安全如何创业自己造网站近年来网络安全大事件特朗普发布网络安全法换网站了吗家里营销电话网络安全案例视频教程b/s架构网络安全德国 网络安全网络安全硬件发展linux网络安全配置营销资源的有效利用gb 信息安全,-1临沂高端网站建设手机网站建设网站规划与网站建设佛山做网站建设新泰做网站网站报价单现阶段营销信息被自动地快速复制扩散或群发的方式主要有医院网站建设解决方案信息安全服务资质证书 级别网络营销网上观察法信息安全之业务安全东莞 企业 网站制作网络安全技术网站网站建设程序开发东莞市做网站的公司网络安全员资格证书东营网站建设落点有误,被迫成了太监的,经历千辛万苦修炼到重生境,得知失去的是大道五十中那循去的一。只有圆满了,才可获得不知道跑到哪里的宝贝! 当气温骤降,末日是否即将到来? 直到人们发现,这一切的一切才开始救赎。智慧的头脑与冷静的心,是面对这一切的最好决策。现代科技不断更新迭代,那厚厚的冰墙却还是亘古不变。为什么? 冰的另一端是什么?这没有人知道。或许是另一个国度,又像是真理的尽头。虚无缥缈的希望与能砍破一切的破冰刀,在人们的手中,又有多少的绝望? 破冰者,这个时代的荣耀,但谁又知,成就之困难。唯有在绝望中诞生的,或许可以借助这一切,去往之真理的圣地。 “所及之处,处处是路,处处是光明,还有先辈们的脚印与他(她)们的热血_”空灵域,苍广无穷,强者林立。 万年前,人魔大战,斩天帝陨落,而在万年之后,废材叶晨被逐出家族,在一次机缘中,得斩天剑诀,从此,空灵域,有一人,名叶晨,领万族,救苍生!他为了女朋友从一线城市到四线城市,可却换来了无情的背叛,看他在这个小城市浑浑噩噩的记录日本留学生竹下青禾为了完成父亲遗愿来到中国找寻祖母小林惠子,通过小林惠子昔日战友和爱人的讲述以及小林惠子留下的日记本,逐渐揭开了那段沉重的历史篇章。头发一抓掉一缕,五黑一排跪一宿!我爱开黑,秃头使我又光又亮!欢迎加入我们的战队,我们有最软萌的妹子,最强硬的汉子,最中二的邪神,最冷漠的游侠以及最佛系的修仙人!我们——秃头小泥巴,柔,硬汉突击P90,这个哥哥嘎嘎猛和asd123,带给你最爆笑的日常!!!李凡 事业有成,家庭美满,却被噩梦缠身 十年噩梦让李凡逐渐崩溃,他决定从根源解决问题。 .......... 梦魇的成因是人为? 他让李凡重生十年前? 十年前的世界异变突生,有神降临! 世界出现了超凡能力,李凡又如何在完全不同的世界里成长,成为真正的神父。人们努力追寻先者的遗迹,却从来看不见后来者的努力。神明用阴谋换来世人的信仰,后来者用鲜血改变他们所创造的世界。龙所走过的路,是龙途,亦是龙屠。水沝淼?……身为网文爱好者的沐尘一直幻想着可以去到唐朝,实现自己的人身理想,一只有好家世混吃等死的咸鱼,终于在带上一只古董手镯后,沐尘实现了一半理想…
东莞市做网站的公司 云计算信息安全公司 怎么做网站排版 一张图读懂网络安全法 重庆网络营销客户 网站建设主页 大连网站建设公司 还有网站吗 美发营销型网站 网站建设成功案例 一张图读懂网络安全法 自己造网站 信息安全等保二级 采购 手机网站建设 德国 网络安全 信息安全学校平台 高中信息技术信息安全 信息安全报 思科2017网络安全报告 手机网络营销存在问题 加强信息安全的建议 京东网络营销推广策略 小红书营销策略分析 东营有网站 b/s架构网络安全 东莞市做网站的公司 2015年国家信息安全专项 淄博网站建设相关文章 网络安全硬件发展 如何利用网站来提升企业形象 网络安全从入门到精通 山西网站设计 上网认证管理系统 信息安全 网络推广营销 微博营销有哪些内容 佛山学校网站建设 金坛做网站 重庆网络营销客户 网络安全裤子 一张图读懂网络安全法