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
网络营销案例工具网络与信息安全第三版霸州建网站做网站讯息汕头网站制作如何买网站如何买网站2013年我国互联网网络安全态势综述信息安全等级保护内容政府对网络营销政策这个世界,儒墨法道,百家争鸣 苏文以为来到以文乱法,以武犯禁快意恩仇的大争之世 没想到却被诡秘所支配…… 我叫祝无双,原本是地府的一名鬼差,因为某些操蛋的理由,我被阎王派到阳间,去做一名高中女生的监护人。“你们怎么看不见我啊!说句话啊!!”“救命啊救命啊!!”“快跑”“这是什么?变身器吗?”“别吃我啊别吃我”……欢迎来到我的梦境,让我们开启一场噩梦旅途吧!一觉醒来,天地大变,卡师为尊! 周明发现自己穿越到卡牌世界。 最重要的是……自己的精神世界里存在一张神秘黑卡,竟能属性加点、技能升级、合成卡牌…… 从此他的人生仿佛开了挂一般,一泻千里! 魅力被他不小心加满,迷倒无数帅哥靓女; 最低等的技能,在他手中也能散发万丈光芒; 只会抱团装死的孱弱魔物,成为翱翔九天的不朽苍龙不再是梦! 异世界众人:这个卡师绝对有问题!!!漆黑里有着一座客栈,两个平平无奇的人儿,三颗好似不会枯萎的树,四盏亮着火的灯,周围有着低低的叫声。不知道客栈有多大,远处有多远,只有那个客栈名才给这个地方带来称呼,圣凡客栈。我们每个人身体里,都有一种可怕,狂野和罔顾法纪的欲望,连那些看似温和的人也不例外。人生多故事,岁月不寻常。 一路风和雨,相逢在此时。  王卿穿越到远古时代,成为饕餮,才统治了这个世界,就被憨憨校花给召唤了,成了她的契约兽!   最离谱的是,连说话的权利都没有了。   “喵?”   “喵你个头啊!”   ......   我叫苏天天,被称为青阳学院的甜美校花!   这个世界,神秘复苏,到处都是妖魔鬼怪,异兽飞掠,厉鬼尖啸……   直到那天,能力觉醒,召唤了我的伴生契约兽。   然而我听到的第一句话就是:“喵?”   一只长得跟小黑狗一样的东西,开口居然是喵喵叫!   夭寿啦~~ 宋末,蒙、金、宋战乱不断,南宋李庭芝、李继先、张世杰三位从小长大的兄弟,一起读书、练武,心怀大志,有勇有谋,共同投身于保家卫国的行列,李继先先后结识了诸如余玠、杨亮节、李芾、王坚、文天祥和陆秀夫等名臣名将,又结识了诸如慧通、玉虚三仙、桃源四剑、潇湘剑客、剑南六洞仙等江湖豪杰,他们虽然出身不同,性情和志向各异,但最终都聚合到了抗敌保国的队伍中,他们忠心于国,侠义冲天,文武超群,在政治与江湖间穿梭,同奸臣、叛徒、敌军、仇人不断对战,最后随着南宋的一路失败和灭亡而纷纷牺牲,余留之人最后看到元朝新生气象后,感到天下一统是民心所向,便顺应大势,退隐山野。 震惊!   九旬老邪祟被当街殴打,并被捏断脖子;河畔女尸被人揪住头发,按在水里差点淹死;冤死灵童被强制劳动每天二十三小时五十九分钟,最终不堪重负,主动报案称有人虐待童工……   吴甚:大家别听外面的人瞎说,其实世界上根本没有邪祟。   众人:我信你个鬼哦,你手里抓的是什么?   吴甚看了看手里已经在翻白眼的吊死鬼,连忙发力,“蓬”的一下将其捏死,看着化为黑雾消散的吊死鬼,笑道:“诺,你们看,什么都没有,一切都是幻觉。”
微网站怎么做 深圳官方网站制作 信息安全 自有 营销授课南昌 网站的标准 网络安全入侵 网络营销竞争大吗 公用网络安全审计 重庆营销策划 企业营销信息平台构建 手机版网站设计风格 社会化网络营销基础 国家信息网络安全标准 重庆营销策划 网站icp备案 网站开发技术方案 网站设计行业资讯 德阳做网站 南通企业网站制作 简述网络安全威胁的几种基本形式 计算机安全与信息安全 百度网络营销搜索推广 杭州网站制 建立网站的作用 网站设计建议 yes网络安全论坛 重庆王网站制作 小型公司网站建设 网站建设流程 美国俄罗斯信息安全 公司信息安全网络升级方案 网站开发技术方案 网站设计行业资讯 德阳做网站 南通企业网站制作 简述网络安全威胁的几种基本形式 计算机安全与信息安全 百度网络营销搜索推广 杭州网站制 建立网站的作用 企业网站优化 个人网站设计模板 拖拽网站 北京昌平网站设计 重庆王网站制作 信息安全 自有 安徽省信息安全测评中心招聘 计算机安全与信息安全 网站设计和备案 美国俄罗斯信息安全 德宏网站建设 服务好的微网站建设 评价一个网站 汕头网站制作 南通企业网站制作 上海手机网站建设电话达内培训 营销机构SEO 网络安全的实施 乾冠信息安全 南昌网站优化公司 网站icp备案 网络安全宣传周专题 计算机安全与信息安全 网络安全缘起 武汉大学网络安全信息 模板网站最大缺点 公用网络安全审计 营销网站优点 网站建设需要具备哪些知识 网站建设流程 华为网络安全合作公司 网络安全交流协会 资源营销站 企业官网响应式网站 网站设计侵权 网站建设预览 网络安全的实施 网络信息安全工程师高级职业教育系列教程,-1 免费注册网站空间 创新型的顺的网站制作 营销授课南昌 2014网络安全形势 德阳做网站 全球2014年的计算机网络安全事件 网络安全专家评审 资源营销站 安阳做网站 网络安全动漫 全球信息安全认证 营销跟促销的区别 信息安全技术 数据备份与恢复产品技术要求与测试评价方法 什么是信息安全事态 佳木斯网站建设 公用网络安全审计 在线教育营销策划方案 2017信息安全企业 安徽省信息安全测评中心招聘 网络安全信息法 中国信息安全奠基人 盐山做网站 校园网站怎么建 信息安全师国家职业 沧州做网站 最大的网络营销公司 南京网站设计公司 温州手机网站制作公司电话 网络安全专项治理报告 云南制作网站的公司 营销跟促销的区别 泰安网站制作 绵阳市公司网站建设 有关网络安全电影 网站设计公司 上海 邢台移动网站建设 深圳市网络安全公司 网络营销行为 中国石化信息安全 南京网站设计公司 深圳官方网站制作 国内 信息安全 网站制作公司哪个好 武夷山网站建设 手机版网站设计风格 深圳 信息安全培训课程外贸企业网站 网络安全培训意义 婚纱摄影网站模板 武夷山网站建设 网站开发技术方案 南京制作企业网站 华为网络安全合作公司 小型公司网站建设 如何建造自己的网站 有关网络安全电影 信息安全和人工智能 模板网站最大缺点 网站设计侵权 做网站讯息 email 营销 信息安全师国家职业 武汉大学网络安全信息 张家港早晨网站制作 网络安全技术视频国家信息安全文章 营销的误点 网络安全国家标准大全 信息安全分保内容 佛山做网站