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
手机打开一个网站说你的浏览器不支持javascrip昆明做网站哪家好秦皇岛网站开发公司网络安全2017网络安全攻防技术人物专家介绍世界环境日借势营销网络安全协议分析实验东南亚 网络安全精准营销河南信息安全公司排名破碎的竹简,修改历史。接续的断玉,破茧重生。华夏大地的历史一次又一次的变幻,究竟哪些是真哪些是假。穿越各大王朝,一个终极的秘密即将揭开。两个组织的碰撞,守护华夏历史的责任。待我将这一切缓缓道来。一场星空探索任务,莫名将我拉进巨大的旋涡之中。本该安分过这一生,可这天地非以我为棋,我便与天斗,与地斗,与吾斗。破了这三界,斩了这牵连,这亿年未破棋局,我便推翻重来,做这三界共主。 男主陈轩穿越成女身开始了与自带老爷爷的少年开始了相爱相杀的旅程。您喜欢系统还是老爷爷?来看浸淫在小说世界多年的老狗来带您系统品味一下二者之间的优劣!仙路诡奇,人道卑微。 众生皆浮屠,仙心如寒霜。 少年方尘意外获得仙缘,心中却只有一愿:愿以手中仙剑,开万世太平!红月过后,怪物苏醒。 一滴眼泪,便能杀人无形。 一句声音,便能尸横遍野。 一只断掌,便能毁天灭地。 苏明哲,看着灰暗的列车,听着怪物魔鬼般的声音,然后就嗝屁了。 一直在纠结一个问题,到底谁才是怪物。 这里没有玄幻,没有穿越;只有新活的生命,逻辑的真实。 这是一个虚构的故事;一个关于生意与情怀的故事。一群年轻人,在小说主人翁李非的带领下,历经千辛万苦,克服重重困难,在小城香州,书写了一段商业传奇。香水星河酒店,一个给予了无数客人美好记忆,承载着一群酒店人理想的航器,在到达了它辉煌的顶峰后,突然掉头…… 结果怎么样?为什么会这样?是历史的悲剧,还是人生的释然?——一千个读者就有一千个哈姆雷特——如果你想得出自己的结论,请阅读天界无际的小说《香水星河》。虽出身白丁,但可与鸿儒比肩; 虽家境贫寒,但举手可赚钱万贯; 虽手无缚鸡之力,但弹指万军灰飞烟灭; 我虽布衣,可做公卿。现代佣兵周文意外魂穿到民国学生周文身上。他利用穿越带来的一颗佛珠的神奇功能,再加上后世带来的经验、知识和技能。打造了一只武功高强、军事技术顶尖的佣兵团队。 他带领这支佣兵团,历经中原大战、淞沪抗战、称雄上海滩。装备了当世最先进的各种武器,最后投身于伟大的抗日战争中。带着兄弟们杀鬼子......I am god! 无知凡人们,献上你们的膝盖吧! 那一天,得知世界真实的辰桓定下一个小目标,成为这世间第一个神! 于是乎,受命于天的他带着上天的馈赠,开始了他收集打工人的历程。 “豺狗的天降陨石竟然在地面砸出一个百米大洞?恐怖如斯。” 杨开召唤战斗暴龙兽使用盖亚能量炮直接在地面砸出一个一公里的深坑。 “大佬?你这是什么魂兽?” 面对众人的震惊,杨开默默转身。 面对着奔腾而来的兽潮,一个金色的大门缓缓在天空中打开
建网站的步骤 新型网络营销是什么意思 马云营销企业 内网信息安全解决方案,-1 广州顶尖网络推广营销方案 南宁制作营销型网站 广州顶尖网络推广营销方案 腾讯网络安全 外贸营销邮箱 2015年11月出台网络安全法 与老公前世的前世案例【www.richdady.cn】 阴间生活的文化背景咨询【www.richdady.cn】 升迁障碍的职场规划【www.richdady.cn】 与老公前世的前世缘分咨询【www.richdady.cn】 存不住钱的自我提升咨询【www.richdady.cn】 学习成绩差的环境影响【Q⒊⒏⒊⒌⒌O⒏⒏O】√转ihbwel 前世今生查询服务咨询【www.richdady.cn】√转ihbwel 公司破产后的员工安置问题【微:qq383550880 】√转ihbwel 不爱读书的改运方法咨询【Q⒊⒏⒊⒌⒌O⒏⒏O】√转ihbwel 外灵的种类咨询威:⒊⒏⒊⒌⒌O⒏⒏O√转ihbwel 塔罗牌占卜与心理分析【微:qq383550880 】√转ihbwel 意外的前世缘分【Q⒊⒏⒊⒌⒌O⒏⒏O】√转ihbwel 如何避免无形干扰因素咨询【微:qq383550880 】√转ihbwel 大龄剩女的婚恋经验有哪些?【σσЗ8З55О88О√转ihbwel 缺心眼的心理调适咨询【www.richdady.cn】√转ihbwel 耳鸣的环境影响咨询【σσЗ8З55О88О√转ihbwel 孩子学习不好的解决方法咨询威:⒊⒏⒊⒌⒌O⒏⒏O√转ihbwel 前世老婆的前世记忆【www.richdady.cn】√转ihbwel 内心恐惧胆怯的前世影响【www.richdady.cn】√转ihbwel 性压抑的原因分析咨询【Q⒊⒏⒊⒌⒌O⒏⒏O】√转ihbwel 信息安全技术 信息安全风险评估规范 gb/t 20984-2007 中国网络安全官网建网站后如何维护 保护信息安全最基础 最核心的技术是 平安信息安全 网络营销评价方法 深圳网站推广 东莞高端品牌网站建设 网站建设合同 本地郑州网站建设 2012 西电电子竞赛信息安全邀请赛西电 信息安全创业的女人国家计算机与信息安全管理中心 广州顶尖网络推广营销方案 无锡做网站多少钱 徐州制作网站的公司有哪些 cdn网络安全 北京建网站公司 池州网站制作公 事件营销缺点 网络信息安全硬件设备 网络安全教育课程 信息安全重大事件2017 敏感信息安全性 娄底建网站 东莞公司网站制作 郑州好的网站设计公司 网站移动端建设 外贸全网营销方案 湘西网站建设 新型网络营销是什么意思 网络安全高峰论坛 网络信息安全服务能力,-1 信息安全等级保护 负责单位 高州做网站 周口做网站 网络安全攻防技术人物专家介绍 c 网络安全编程 优优营销软件站 网站优化吧 网络营销评价方法 网站设计 广西 外贸营销邮箱 信息安全性测试 败笔网络安全技术 网站格局 广州做网站的 网络营销的营销渠道 支付宝营销策划案例 网络及信息安全设计 秦皇岛网站开发公司 秦皇岛网站开发公司 俏江南营销 鸟哥的linux私房菜 认识网络安全 卓进网站 潍坊网站制作 专业开发网站公司 网站建设营销的技巧 超索引擎营销 网站设计 广西 建立信息安全应急管理 运营商 信息安全,-1 网络营销11 深圳网站推广 南京营销型网站 公司网站制作 步骤 信息安全部官网 信息安全重大事件2017 信息安全运营 广州顶尖网络推广营销方案 cdn网络安全 信息安全外包评估方法 网络营销系统平台 如果做到信息安全 本地郑州网站建设 网络营销系统平台 建网站的步骤 网站定制 天津 常州专业网站建设公司 大型免费网站制作企业网站必须实名认证 税务系统信息安全基本要求 高州做网站 网络安全攻防技术人物专家介绍 北京企业网站开发多少钱 建立内部网站 保护信息安全最基础 最核心的技术是 北京建网站公司 网络安全和渗透测试 网络安全法 讲解 佛山新网站制作机构 网站的设计、改版、更新 常见网络安全的威胁和攻击有哪些 网站建设模板 网络营销实践内容 广州顶尖网络推广营销方案 信息安全的企业信息安全 建网站的步骤 腾讯网络安全 什么是网路营销 网络营销11 网络信息安全硬件设备 网站知识 信息安全管理培训 电器 网络营销 手机打开一个网站说你的浏览器不支持javascrip 外贸全网营销方案 亚太信息安全大会 昆明微信网站建设 腾讯网络安全 网络安全产品 选型 河南信息安全公司排名 龙岗网站设计 广州产品营销公司 网站知识 2017网络安全峰会视频 败笔网络安全技术 中国网络安全官网建网站后如何维护 网络营销人才需求 广西首届网络安全 平安信息安全 网络营销历史发展 信息安全预警服务 深圳网站推广 信息安全 政策法? 北京企业网站开发多少钱 网站建设合同 龙岗网站设计 新型网络营销是什么意思 网络安全4292017 微信营销培训 卓进网站 微黄式营销 网络营销历史发展 网络安全系统公司 网络口碑营销成功案例 北京代建网站 北京企业网站开发多少钱 周口做网站 网络信息安全服务能力,-1 太原网站建设dweb 全国信息安全邀请赛 深信服 国家信息安全测评信息安全服务资质 安全工程 微信营销培训 中国网络安全官网建网站后如何维护 广州做网站的 池州网站制作公 cdn网络安全 c 网络安全编程 顺德网站建设基本流程 蚌埠网站建设 瑞士 网络安全 建立信息安全应急管理 世界环境日借势营销 信息安全技术 信息安全风险评估规范 gb/t 20984-2007 全景网络安全 世界环境日借势营销 池州网站制作公 网站优化吧 网络安全攻防技术人物专家介绍 零食网络营销策划方案 网络安全信息安全实验室 传播营销策略 潜江网站建设 高碑店网站建设 秦皇岛网站开发公司 网络安全警示 郑州好的网站设计公司 网站设计 广西 信息网络安全包括 用html5做的网站 微信小程序与网络营销 网络安全等级测评 海军工程大学信息安全 营销博文 传播营销策略 信息安全重大事件2017 网站定制 天津 信息安全性测试 网络营销评价方法 信息安全漏洞 云南 信息安全创业的女人国家计算机与信息安全管理中心 昆明做网站哪家好 南宁制作营销型网站 网络营销评价方法 网站格局 网络口碑营销成功案例 河南信息安全公司排名 网站格局 关于网络安全的建议 局域网的网络安全 单位信息安全等级保护工作是否做了部署 北京企业网站开发多少钱 蚌埠网站建设 娄底建网站 网络安全云管理平台 网络安全协议分析实验 手机网站建设的趋势 网络营销的营销渠道 败笔网络安全技术 常见网络安全的威胁和攻击有哪些 精准营销 网络安全高峰论坛 网站优化吧 税务系统信息安全基本要求 南京营销型网站 南京营销型网站 无锡做网站多少钱 网络及信息安全设计 信息安全运营 中国信息安全公司有哪些 德阳网站建设公司 网站移动端建设 高州做网站 网络安全4292017 东莞高端品牌网站建设 德阳网站建设公司 手机网站建设的趋势 秦皇岛网站开发公司 支付宝营销策划案例 手机网站建设的趋势 信息安全等级保护 负责单位 网络营销软文 网络营销学习 关于网络安全的建议 高碑店网站建设 鸟哥的linux私房菜 认识网络安全 营销的作用 平安信息安全 信息安全技术 信息安全风险评估规范 gb/t 20984-2007 网站建设营销的技巧 信息安全服务资质 安全开发 mmm营销 优优营销软件站 运营商 信息安全,-1 局域网的网络安全 新型网络营销是什么意思 总参网络安全防护中心 公司网站制作 步骤 c 网络安全编程 网站格局 网络信息安全硬件设备 营销方式方法有哪些内容微信小程序与网络营销 2015年11月出台网络安全法 无锡做网站多少钱 手机打开一个网站说你的浏览器不支持javascrip 网络安全信息安全实验室 网站优化吧 茶叶网站建设 保护信息安全最基础 最核心的技术是 手机网站建设的趋势 太原网站建设dweb 瑞士 网络安全 外贸营销邮箱 微信小程序与网络营销 昆明微信网站建设 信息安全等级保护 负责单位 网络安全4292017 微信营销培训 卓进网站 微黄式营销 网络营销历史发展 网络安全系统公司 网络口碑营销成功案例 北京代建网站 北京企业网站开发多少钱 周口做网站 网络信息安全服务能力,-1 太原网站建设dweb 全国信息安全邀请赛 深信服 国家信息安全测评信息安全服务资质 安全工程 微信营销培训 中国网络安全官网建网站后如何维护 广州做网站的 池州网站制作公 cdn网络安全 c 网络安全编程 顺德网站建设基本流程 蚌埠网站建设 瑞士 网络安全 建立信息安全应急管理 世界环境日借势营销 信息安全技术 信息安全风险评估规范 gb/t 20984-2007 全景网络安全 世界环境日借势营销 池州网站制作公 网站优化吧 网络安全攻防技术人物专家介绍 零食网络营销策划方案 网络安全信息安全实验室 传播营销策略 潜江网站建设 高碑店网站建设 秦皇岛网站开发公司 网络安全警示 郑州好的网站设计公司 网站设计 广西 信息网络安全包括 用html5做的网站 微信小程序与网络营销 网络安全等级测评 海军工程大学信息安全 营销博文 传播营销策略 信息安全重大事件2017 网站定制 天津 信息安全性测试 网络营销评价方法 信息安全漏洞 云南 信息安全创业的女人国家计算机与信息安全管理中心 昆明做网站哪家好 南宁制作营销型网站 网络营销评价方法 网站格局 网络口碑营销成功案例 河南信息安全公司排名 网站格局 关于网络安全的建议 局域网的网络安全 单位信息安全等级保护工作是否做了部署 北京企业网站开发多少钱 蚌埠网站建设 网站设计 广西 网络安全教育课程 网络科技网站设计 常州专业网站建设公司 新型网络营销是什么意思 国家网络安全月 腾讯网络安全 敏感信息安全性 信息安全重大事件2017 中国网络安全官网建网站后如何维护 中国信息安全公司有哪些 北京建网站公司 郑州好的网站设计公司 专业开发网站公司 俏江南营销 网络安全产品 选型 信息安全管理培训 北京企业网站开发多少钱 网站的设计、改版、更新 微信小程序与网络营销 本地郑州网站建设 潍坊网站制作 网站知识 网络安全中的个人信息安全 郑州好的网站设计公司 电器 网络营销 鸟哥的linux私房菜 认识网络安全 信息安全管理培训 网络信息安全服务能力,-1 网络营销系统平台 信息安全预警服务