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
网络安全技术规范网络软文营销的特点网络安全共享中心慈溪网站设计网络营销的优势与劣势医疗大数据信息安全,-1企业网站可以备案个人上海市信息安全活动周信息安全 相关单位网络安全实验报告东营有哪些制作网站常州网站推广方法深圳市能士信息安全公司什么是网站推广做购物网站圣诞节网站模板梦想网络安全技术论坛国外优秀网站设计欣赏信息安全口令网络营销策划流程网站制作公司 信科网络重庆企业网站推广最优的网站建设网络营销人员能力中国计算机网络信息安全展多语言网站郑州网站建设网站维护公司双城网站qq免费建网站穿越你见过,穿越两次的你见过没? 好不容易穿越古代成了王莽,一出场就干死天下所有刘秀,可兢兢业业那么久,还是一朝帝王变打工! 再穿越,我服了,我躺平了,我摆烂了,我做一个普通人总行了吧? 只是这粮食不够吃,总得研制下肥料吧? 天啊,上厕所还要棍刮,奶奶的,我造纸还不行吗! 看个颜色小说还要手抄,活字印刷术搞起! 皇帝:尔有大能,可愿入宫为官? 别,我是废物,我只想做平民百姓! 五钥开玄天,双子换平生。一劫天下知,万众盼帝生!苏陌,白慕雅两人因王者荣耀而相遇相识,会碰撞出怎么样的火花呢?让我们拭目以待吧。懂事的人负责任的人,也就是别人口中的老实本分的人,吃亏和傻缺的另外一种叫法,峰回路转与好人好报,只会在戏中剧中。一生平平无奇的莫辰穿越到修仙大陆,本以为能一生无敌,创造无尽辉煌……………………………………………………确实如此。我的第一个小说,想以小说的形式描绘出我(一个肥宅)的幻想世界,故事中男主黑屿在夜晚意外觉醒了沉睡已久的超能力【罗生门】,这是一种通过达成未知条件来不断进化的能力,他将使用【门】中封印的【们】以【漆黑】追逐光明我和几个兄弟喝醉后醒来竟然穿越到别的世界,真尼玛离谱世界是被异常的嗜睡症击中,并出现大量人员昏迷。蔡苏宇陷入异常的嗜睡症,被转移到次元战场。【系统+游戏+同人+童年回忆+爽文+升级】 王超穿越洛洛历险记世界,成为一名普通能源之城 战士,原本以为沦为炮灰的他,却觉醒无敌升级系 统。 “叮!新手大礼包领取成功,获得能源紫水晶 x1000000!” 卧槽!???你管这玩意叫新手大礼包?” 仙界传闻:这世上唯有月老王尧不能招惹,得罪别人大不了一战,得罪月老,一不小心族谱的下版本就交代在这了! 穿越青年王尧被迫成了新晋月老,方才发现,月老这号神仙,听上去好像只是个鸡毛蒜皮的小官,竟然很吃香……
做购物网站 软件信息安全测评中心待遇,-1 网络营销的4c理论分析 京东商城的营销环境 qq免费建网站 网络营销的调研报告 深圳市能士信息安全公司 合肥网络安全 宜兴做网站 空间对营销的影响 深圳市能士信息安全公司 网站制作公司 信科网络 qq免费建网站 网络营销的调研报告 中国计算机网络信息安全展 网站免费搭建 河南信息安全 东莞 网站设计 网站总类 北航信息安全专业 东莞 网站设计 杭州 网站建站 营销问答 airbnb的营销策略 2016网络安全案例事件 网络安全(二级) 信息安全管理体系包括 网络安全部 网络营销基础 信息化与网络安全 中央网信办网络安全 网络营销的4c理论分析 论坛营销的优点注册信息安全员怎么样,-1 邢台网站设计厂家 四叶草网络安全公司 无锡建设网站 网络安全基础 协议安全 西安免费做网站公司 深圳全网营销总裁班 双城网站