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
成都网络安全技术公司武汉便宜做网站vmware替代网络安全闸网络营销标语济南网站制做网站建设名牌工控 网络安全 招聘如何建造自己的网站深圳h5网站公司邮箱营销软件哪个好用网站制作公司 云南深圳网络营销公司排行榜网络与信息安全管理人员配备情况紫色网站模板葫芦岛网站建设狼客网络营销关于网站出现.ldb文件网站打不开解决办法换成sql server网络安全 期刊顺的品牌网站建设怎么攻击网站网站制作公司 深圳手机响应式网站易尚网络营销公司营销外包公司网络安全 签名黑白灰网站杭州市网络安全网络营销和互联网运营网站页面网络安全 csdn网络安全 签名扬中网站建设呐,说话要讲证据! 我区区一个宗门杂役,怎么会是全能大师呢? 还有,我只是武气六段的菜鸡,怎么可能把师兄指点成首席弟子呢? 至于那些神兽、武皇、魔教……都听命于我?我不是我没有别瞎说。 最过分的是,我一个怂包,你们竟然怀疑第一美女师姐喜欢我? 好吧,就算这些都是真的,难道我想当一条咸鱼也有错吗?叮!恭喜宿主拾取【神仙颜值】,林枭:“我终于能变帅了吗?”林枭走出家门,“轰”林枭顿时被劈的七荤八素,“叮!由于宿主颜值严重超标,所以宿主不戴面具出门会被劈”林枭:“·-·系统我真的好‘喜欢你’啊,我被感动了。”当宝可梦世界不再美好和和平,一切涌动在那平凡的表面下的黑暗都将被揭露,我们的男主云扉——一位21世纪宅男,又将以怎样的手段改变这一情况呢? 云扉:‘去吧,阿伯怪,使用亚空裂斩!’ 路人:‘纳尼,你这阿伯怪招式不合法。’ 云扉:‘我是阿尔宙斯指定的男人,当然合法。’ 且看云扉在宝可梦世界里如何一步步走上巅峰,又是怎样成为黑白两道的王。一个只有七岁的小男孩,没有任何修为。。。 一个凡人就敢叫板修炼者、最后差点死掉。。。 不被亲戚以及任何人待见的王无尘,晕倒在路边,被七彩宏光救醒。。。 撞见小姑被辱 激发无名怒火,唤醒七彩红光,使七彩发生变异,从此身高定格在一米六五。。。 被人侮辱、辱骂、各种各样的嘲笑都不在乎,就是不能触碰底线。否则,让你知道花儿为什么那样红。。。 宇宙掌控者阻挡我,我就撑破你的宇宙,把你的宇宙挤压成一团。 王无尘一步一步的建立门派,带领兄弟,踏着纨绔子弟、自以为是、狗仗人势的肩膀踏上修真界,踩着修真界、仙界、神界、圣界、虚无界、甚至宇宙掌控者的尸体,走上哪个高度,成为无上主宰乾坤生是非,引得猛虎啸,从此世上无太平。如果看小说累的话,就来看看诗吧,偶尔写写小诗,偶尔让生活多些浪漫飘渺大陆是一个灵气充沛的世界,在这里,修炼者无处不在,也无所不能。 灵丹、武技、功法、秘术、这些都是修炼者一生追求的梦。 其中,被誉为天地葵宝的八系灵珠更是天下人必争之物。 **很唐突的就穿越到了这个世界,天选之人往往都是有着上天眷顾的光环。 在一次生死逃亡之下,他无意掉入了一座古老的墓穴之中,没有意外的就得到了符文铁卷,从此,他的黑色怒瞳成为了许多人挥之不去的梦魇! “霸决!” “残决!” “杀决!” “毁灭能量丸!” “千盘吸手!” “大崩裂术!” 一道道凶猛无匹的武技摧毁了一切敢于与他叫嚣之人,世人见他无不顶礼膜拜。 挚爱之人永远离他而去,心脉精血狂撒的那一刻开始,他的一头青丝骤然变成了沧桑的银白色。 坐在雪峰之上守候着那个曾经的约定,黑色的怒瞳成为了这个时代最引人争议的标志。 “重新开始也未必办不到,就让我重新塑造这个世界吧,一切的轮回皆由我执掌……” 最近王诺家里的镜子好像有点不对劲。 有时在东边,有时却在西边,好像又在北边....... 不仅镜子里映出的家具位置发生了变化,而且镜子里的自己好像也越来越陌生了....... 镜中的“他”目光由窥探变成了贪婪。 镜子里的你,真的是你吗?古烬在创造女神的空间中醒来,发现自己失去了大部分记忆。在被女神的帮助下,他恢复了记忆,并与女神度过了一段快乐的时光。 一切止与古烬和女神的一场赌约。 他穿越到了女神创造的世界之一,在其中展开了冒险。 (敬请期待)不是说报恩最好的方式就是以身相许么?为什么当他想用这种方式报恩时,却被对方嫌弃到不行?是因为自己不够美吗?好,那他就长成一个比倾国倾城的大美女还要美的绝世美人后再来找他,看他还有什么借口拒绝!
网络安全属性和攻击的基本模式 深圳网络营销公司排行榜 德州做网站 中山网站设计 全球网站建设服务商 网络营销师值得学吗 企业网站建站元素 网络安全 签名 邮箱营销软件哪个好用 信息安全意识培训方案 2014中国信息安全报告 成都网络安全技术公司 营销价值观是什么 2014中国信息安全报告 网络安全博览会英文 网络安全 情况 建网站公司 金融网络安全案例分析 网站建设空间 2014中国信息安全报告 营销型网站模板 网络营销的新闻 微营销真的假的 广东信息安全专业介绍 中国国家信息安全漏洞网站 营销外包公司 网络安全 期刊 手机网络安全技巧 vmware替代网络安全闸 网站设计和备案 网络营销型企业网站案例 饥饿营销的作用 云南信息安全等级保护 深圳h5网站公司 重庆怎么做整合营销 南宁市制作网站的公司 网络安全年会 龙岩做网站 黑白灰网站 网络营销所面对的挑战