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
信息安全咨询服务方案见网站建设客户技巧网站的风格成都的信息安全公司石家庄网站设计制作服务网站设计小技巧会员式营销案例免费注册网站信息安全服务一级资质临沂做网站杭州网络安全公司 地址异世界重生 一穷二白, 苏醒后只有个关心自己的漂亮妹妹。渊辰是男生的名,临渊星辰。深邃,明亮。他是游走于世间的鬼魂,时而有质,时而无质。非人非仙,三界不留。不知何所从来,亦不知何所归去?用心,记下这浮生相遇,探寻生命的起点和终止!以及他背后的真相……如果知道那是最后一次见你,我一定不会让你离开 樱花树下的约定,是故事的开始;他永远的失去了她,却意外穿越了平行时空,来到俩人最初相遇的时候,与此同时;以前的自己也来到了以后,一个完全陌生的世界。 事情会发生什么改变呢?历史是否还会重来,一切都拭目以待。梦里,叶燃扛着一座监狱满世界抓贼,顺便收了几个小弟,教了几个徒弟,养了几个宠物。 梦醒后,小弟成了诸天大佬,徒弟成了神级宗师,宠物成了超级神兽。 某个游手好闲不学无术的私生子,则一脸懵逼的看着手上的天劫监狱里,关着的一群大魔王…… 这特么的不是梦?! ……车辚辚,马萧萧,行人猎枪各在腰; 村镇灯火不再现,黔首飘曳迦南遥。金天问身具极品根骨,但是被青梅竹马的玩伴谷艳红陷害,使用邪术盗走了极品根骨,这让金天问成为了废人。 金天问发誓一定要报仇雪恨的,但是,谷艳红已经成为了武功派掌门的亲传弟子,位高权重,势力庞大,金天问只能暂时隐忍,等待报仇的机会。 为了斩草除根,谷艳红恳求武功派掌门派人将金天问掳来,放在悬空的铁索桥之上,铁索桥的两端,有剑气逼人的灵剑和凶猛的妖兽赤目白猿阻挡,让金天问无法离开,只能等死。 此时,金天问觉醒了万倍模拟修炼系统,能够让时间暂停,修炼上几百天、几千天,如此,金天问在系统的帮助下,终于可以修炼了,达到了金刚境第三重的境界,拔出了剑气逼人的灵剑,然后斩断了赤目白猿的铁链,放走了赤目白猿。传言心门每名弟子都是门主,都是强者。 ……… 破天荒的,那个平时最冷漠的人出“门”了… ………妹妹得来癌症,杨涛不得不从事扒手职业,但是在一场意外之中,杨涛被神秘的光球带去了七千年后,杨涛在七千年的地球,了解到了自己离开后地球上的变化,觉得很是愕然于震惊。但是考虑到自己离开后,没人照顾的妹妹,杨涛下定决心要回去,觉得既然光球能带自己到这里,同样,自己也能依靠着光球回去。杨涛在七千年后的时空,发现了自己不怕攻击,并且还能化他人的能量为己用,就这样,杨涛从弱小成为全宇宙的主宰,并利用自己的力量回到家最初与妹妹的时空.........秋天的飞鸟远飞而去,停留到圣洁的桐树之上,预示着可怖的黑暗即将到来,迷惘分散的灵魂们,在命运的牵引下聚集起来,不再分离,成为一体,踏上新的旅途,开始了新的生命。 即使那段过往已经不再记得,但是灵魂却还记得,无论是欠你的那一个拥抱,还是那一句对不起........我带着我的梦想,一直向前奔跑,守护着背后的大家,还有你。就像书名上写着的,你加载了危险游戏。 总之我得,在游戏正式开始前,给你个忠告。 呃,没错,说得就是屏幕前满脸不在乎的你... 在这里! 你不该相信任何人! OK!就这样... 总之不论你是谁,在哪里,请相信我,在看到这里的时候,你已经被卷入进了这场危险的游戏当中! 你可以试着回头,可以盯住屏幕,可以闭上眼睛... 但不论你怎么做,它们就藏在你身边,或许是卧室的床下面,或许是卫生间的镜子里(谁知道呢,它们的喜好向来与众不同)。 呃... 该死—— 它们发现我了! 看来我只能送你到这里,下面的路,你得靠自己走了! 还记得我最初说过的吗? 不要相信任何人! 包括... 从床底下朝你伸出手的我!
网络安全信息安全实验室 湖北网络安全备案设备 网站的风格 学校网站设计 流行的网络安全软件 青岛市网络安全办公室 网络营销策划的特点 帮人做网站 4.许可e-mail营销的三大基础是什么?分别解决哪三个问题? 上海网站建设要多少钱 免费kingcms模板影视制作公司网站模板+原程序下载 信息安全课攻防实训 网络营销引流软件 网络营销是什么意思? 企业信息安全培训ppt seo是网络营销吗 商务型网站模板 网络安全文章 商务型网站模板 网站建设优化文章 珠海高端网站制作公司 网络营销策划的特点 B2B网站系统 湛江网站开发 网络安全法颁布的意义 网站建设优化文章 2016 网络安全竞赛 工信部 网络营销学文稿 湖北省网络安全等级保护网 郑州个人做网站 网站设计小技巧会员式营销案例 学校网站设计 成都的信息安全公司 延安网站建设 免费建站网站大全 临沂做网站 大连企业做网站 信息安全咨询 企业 网站访问流程设计 石家庄网站设计制作服务 网页设计分享网站 网络安全项目测评 商业网站建设 信息安全等级测评网 昆明信息安全培训,-1 智能建网站 智能建网站 临沂做网站 校园网站设计 网络营销的知识要求 网站移动端开发公司 工控信息安全 责任 衡水企业做网站 中国信息安全测评中心 信息安全服务资质网络营销在哪些行业 对于网络安全的建议 网站制作价 外贸网站的建设 合肥全网营销 2017信息安全奖学金,-1 信息安全风险评估作用 网络安全工程师 培训 营销式建站什么意思 南通动态网站建设 青岛市网络安全办公室 耒阳做网站 台州高端网站建设 网站营销方案 网络营销学文稿 四视图网站 专业的高端企业网站 成都 网站建设 欧盟网络安全 哪一年 石家庄企业商城版网站建设 上海网站建设要多少钱 网站微博营销哪个好用 郑州网络营销策划公司 信息安全三级等级保护 p2p网站建设 p2p网站建设 耒阳做网站 2016 网络安全竞赛 工信部 石家庄企业商城版网站建设 聚美优品营销方案 西安网站制作 湖北网络安全备案设备 网站优化的优势 网络安全现状 2017 网站欣赏】 色系网站 微网站建设方案 营销活动培训班 购物网站建设 微信社群营销工具 石家庄专业模板网站制作价格 见网站建设客户技巧 网络安全信息安全实验室 团购营销 徐州网站推广 佛山网站推广 大连企业做网站 中科大信息安全如何近五年网络安全大事件 信息安全课攻防实训 信息安全审计 公司 湛江网站开发 网站制作价 佛山外贸网站建设平台 企业网站首页布局尺寸 网站转化率信息安全实例 微商城网站建设 网络安全 特训 网络安全 特训 网络安全现状 2017 合肥全网营销 微博营销网站的功能 网际天娇信息安全技术服务 3g手机网站 信息安全咨询 企业 网络安全性是什么协议 青岛建网站 o2o电子商务网站 推广营销策划 学校网站设计 常用微信营销方式 网站营销方案 信息安全课攻防实训 湖北网络安全备案设备 网络安全和信息化职责 自己建的网站打开的特别慢 流行的网络安全软件 网站被 推广营销策划 上海网站建设要多少钱 网络安全 认证 移动互联网 安徽网站建设 北京 网络安全 公司 网站都是每年续费的吗 B2B网站系统 长沙网站制作公司 网站设计) 石家庄企业商城版网站建设 台州高端网站建设 3g手机网站 虹口做网站 哈工大网络安全响应组 重庆网络营销是什么意思