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
网络推广营销招聘网站建设的售后哈尔滨网站设计遵义网站建设国家信息安全局待遇门户网站建设网络安全培训意义国家信息网络安全局陕西省网络信息安全办公室成员信息安全认证技术有限公司爷爷宁愿坐牢十年,都死守的秘密。 终于在十年后, 重见天日,我传承爷爷的秘密,揭开了那些不为人知的往事……与天对抗,共争仙路,一将功成万骨枯。 三息永恒,一声叹息,回首只叹一场空。 打破桎梏,杀身成道,亘古阴谋迷雾散。 上承仙元,下启道古,三世轮回永无终。有人说神话的尽头是科学,纵观人类历史,腾云驾雾与飞机火箭,无不正是遵循这一规律! 也有流言说科学的尽头是神学,时间终会找出造物主,但却只有建国以后不许动物成精的卖萌段子! 神河文明、科技文明,当两种几乎对立的文明不期而遇之时,是两者的灾难灭亡还是两者的共赢共生?又或是争锋之下此消彼长? 末世降临,人心一步步变质! 末世之下,是破茧成蝶的新生,更是种族灭绝的毁灭! 本杂记是以心情日记书写的,元素分为古诗绝句、律诗,英文诗,现代诗歌,词曲,宋词以及散文。十五篇一轮回,变化多端,内容丰富。陌生朝代一品大将府的庶子,突然融合了一个现代人的记忆。 这段记忆会给他带来怎样的变化?又会给这个世界带来怎样的变化? 也许生活有不同的际遇,有不同的改变;也许生活没有你想地那么顺畅,总有一些希望,在你的前方,让你不曾放弃。他们就像月亮花一样总在远处静静地等待,静悄悄地开放,无人知晓。有点昏暗,但带着光芒,指引着你我。马县长为了权力,官运亨通,迷信五行八卦等歪门邪说,不断做局,一步步设计各种案件,试图嫁祸给孔家,最后被葛探长识破奸计。 有着衍生资源美名的梦谕,被世人称作神明的遗物,曾有人掌握他,却带来毁灭性的灾害。 名为魇的怪物与人类一般无二,在梦谕吸收着扭曲的情感以及不幸因素。从而造就成极端的能力与性格。 及时如此,危险的怪物在梦谕濒临瓦解时被人类捕获。成为了满足欲望的工具与珍贵的交易品…… 一只逃避追杀的魇在雪地里昏睡,被路过的红衣男孩所救。在无形之中建立了契约关系,而那男孩便是世间罕有的契师。 故事的开端打开,能够完全操控魇的契师诞生。旧时代的往事将被重新掀开,梦谕的正面目也即将显露 陈寻怎么也想不到,自己机缘巧合参加的一次相亲经历,竟然就此翻转了他的整个人生。平头小子苏禅,带着妹妹苏婉儿到处流浪,岂料命运不济,遭受恶人毒害,身中奇毒,静脉尽断,险些丧命。天不绝人之路,开启系统,提升修炼。一边复仇一边恋爱,顺便带妹修仙。
免费注册网站空间 保定 网站建设 个人网站设计模板 网络安全风险管理 网络营销怎么做见效快 哈尔滨网站设计 通信信息安全培训 哈尔滨的网站设计 国家信息网络安全局 筑巢网站 企业网站设计经典案例 通信信息安全培训 聊城网站建设招聘 信息安全的人员安全,-1 中国大学生信息安全 个人网站设计模板 搜索引擎营销策略分析报告 网络营销目标是什么意思 重庆网络营销怎么样 网站改版方案 网站制作好在百度里可以搜到吗 营销做什么 蓝盾网络安全(二级)测评记录 网站制作好在百度里可以搜到吗 厦门网站排名优化软件 筑巢网站 密码技术是网络安全 信息安全系统登记备案 网络与信息安全事件 无线网络安全设置方法 南京餐饮网络营销公司 信丰做网站 外贸企业网站 做网站用动易siteweaver cms还是phpcms 韶关网站建设 台山网站建设 网站建设品 东华大学 信息安全 厦门网站排名优化软件 网络营销目标是什么意思 信息安全认证技术有限公司 北京邮电大学 信息安全 网络安全培训意义 网络安全运维面试题 营销体系的内容 信息安全技术信息系统等级保护安全设计技术要求,-1 北京邮电大学 信息安全 广州网站制作公司 成都网站设计制作工作室 国际间网络安全合作 网络安全ppt 下载 余额宝营销 成都 企业网站建设公司 昆明网站排名优化费用 网络有哪些营销方式有哪些内容 济南信息安全管理培训,-1铜仁网站建设 网络营销之微信 网络营销怎么做见效快 亚太地区信息安全问题 做个网站要多少钱 太原市做网站 重庆网络营销怎么样 网络营销网上营销 网络营销案例心得 网络安全法 正式 信息网络安全普及教育培训教程 网络营销环境的内容 功能营销 信丰做网站 通信信息安全培训 美国网络安全立法 网络安全密钥怎么破解 网络安全 数据安全 台山网站建设 经营模式和营销模式 深圳企业网站制作报价 昆明网站排名优化费用 企业网站模版 网站外接 国内网络安全形势 中国信息安全测评中心 上级主管部门什么是营销型的网站推广 网络营销发展课 长沙手机网站设计 濮阳网站建设 合肥网站设计高端公司 网络安全关注的问题 武夷山网站建设 把网络安全作为头等大事 当前php环境关闭了文件上传功能网站将无法上传图片和文件 信息安全等保分级 濮阳网站建设 网络营销与马云 网络安全培训意义 网站建立公司四川 哈尔滨的网站设计 网站建设预览 聊城网站建设招聘 衡水移动端网站建设 网络安全违法举报中心 通信信息安全培训 公共网络安全 江苏 信息安全 免费注册网站空间 信息安全等级保护定级备案 网站费用 廊坊网站建设高校帮软文营销 国家信息安全产品认证型号证书 国家信息安全产品认证证书 网络安全ppt 下载 网络安全关注的问题 一个网站做几个关键词 泰安网站建设公司 门户网站建设 电商网站建设 长沙手机网站设计 黑龙江网站建设中国中央网络安全 网站的重要性 美国网络安全立法 品牌营销软文案例 韶关网站建设 信息安全的人员安全,-1 网络安全密钥怎么破解 企业多品牌营销计划 厦门网站排名优化软件 中国信息安全标准分类 信息安全服务资质安全工程类 成都网站设计制作工作室 成都网站设计制作工作室 洛阳 网站建设 深圳企业网站制作报价 中国信息安全测评中心 上级主管部门什么是营销型的网站推广 网络营销怎么做见效快 企业网站设计经典案例 深圳企业网站制作报价 东华大学 信息安全 成都 企业网站建设公司 通信信息安全培训 网站建设的售后 加强网络安全管理 找柳市做网站 win2008网络安全 密码技术是网络安全 佳木斯网站建设 网站设计步骤 网站外接 济南信息安全管理培训,-1铜仁网站建设