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
天津网站建设怎么样e mail营销邮件黑客对网络安全的影响网络营销师证书名称开商城网站专业网站设计建站上海网络营销平台排名快速网络营销费用网络营销策划公众号什么是网络营销产品策略北京网站设计公司1 网络安全威胁常见的有哪几种信息安全就业好吗网络安全技术架构兰州网站建设报价分析亚马逊营销的特点网络信息安全和合作专业的网站建设网络安全审计参数四川省信息安全基金信息技术与信息安全考试系统推广类网站个人信息安全评估办法全国信息安全技术水平考试无线网络安全隐患电视剧网络营销策略2017中国网络安全峰会2017中国网络安全年会输入网络安全性金?信息安全等级保护工具箱网站 托管 间谍是一个非常古老的职业,从有战争开始的那一天起,间谍便是交战双方获取对方情报的唯一选择。有人说,间谍战是这个世界上唯一不会出现硝烟的战斗,可事实证明,没有硝烟的战斗在这个世界上几乎不存在,即便是暗地里的较量,同样充满血腥和牺牲。 我姓唐,叫唐城,你也可以叫我唐五郎。 我爹是军统,专门抓日本特务的军统,虽然他不在了,可小爷我也绝对不允许你们这些萝卜头活的逍遥。 这里是国统区,所以,这里没有你们存活的空间。如果你们非要来,那好吧,小爷我只好送你们统统下地狱。宋清书穿越综武世界,成为武当三代首徒宋青书,本应该是一个神仙开局。 然而宋青书已经杀了师叔莫声谷,还背叛丐帮,正在被陈友谅追杀,随时可能丧命。 就在这时,绝世舔狗系统激活。 绝世武库向他敞开,只要赚取积分,就能疯狂买买买。 九阳神功,买! 凌波微步,买! 战神图录,买! 咦,竟然还有八九玄功和草灭剑诀,难道……《摩觉》原名为《千古纪法》,一个励志除魔卫道的故事。故事基于现实与虚构的结合,有天马行空,也有实事求是,更有意想不到。故事也向许多的武侠小说经典之作致敬,力求精彩而又完整,一部武者之道的新作送给大家。乱世之中为了能让自己的兄弟姐妹们有一个安身立命之所,他倾尽全力带领手下把一个小小基地,建成了一个足可媲美三大阵营都城的城邦,他半生中之身单挑三大尸王,率众对抗鹰美联邦,粉碎了敌人一次次的进攻,他和他的部众南征北战,东挡西杀,创下万世不拔之基,留下无数传奇故事。可他确在事业如日中天之时,选择了功成身退,带着爱侣远赴海外荒岛,做起了一对神仙眷侣我睁眼闭眼脑袋里面全是你,我做梦都想保护你,你尽管往前走,你保护世界我保护你。家亡国破,四面楚歌,在这种危机时刻,是隐名埋名,苟且偷生?还是忍辱负重之后一路披荆斩棘?还是那句老话,天下乾坤未定,你我皆是黑马…… 夜晚的霓虹下,壁垒中的人类尽情的放纵着自己的激情。 但他们并不知道,阴影中的怪物们正死死的盯着他们,随时准备着剥夺他们的生命。 这些怪物隐藏在人群之中,嘲笑着人类的无知与愚昧。 十八岁的李如一却有着能够找出他们的技能——回溯。 六年前,李如一穿越到了这个科技发达且充满危险的异世界,为了成为超凡者而不懈努力; 六年前,两个猎魔人偷偷潜入13区19号城市; 六年前,一个叫做任小兰的老妇人牺牲了自己的生命; 六年前,一场大火烧毁了一个希望; 六年后,一个中年男人和一个老人下着棋,聊着天。 老人问道:“你难道不知道李如一很可能会毁掉这个世界吗?” 中年男人说道:“但他也有可能拯救这个无药可救的世界啊,不是吗?” 瓢泼大雨中,他没有挪动脚步的打算。一动不动,仿佛灵魂已经脱离了躯体,毫无知觉,雨水夹杂着寒风肆虐的侵蚀着身体!.............不知过了多久,他终于动了,却是漫无目的的微微挪动着脚步............大魏王朝,妖魔乱世,幽鬼横行。 当顾青玉睁开眼睛醒来之后却发现自己只有七日可活! 无奈之下,只好凭借驯养系统驯养一只青龟,将其化作自己的一个分身! 【叮!是否消耗成长点驯养青龟?】 【驯养成功!】 【青龟等级提升!】 …… 【叮!是否消耗进化点进化天元青龟?】 【进化成功!】 【天元青龟进化成为:天元龟!】 【叮!获得能力‘天元一气’!】 …… 顾青玉发现,自己驯养的分身不但可以不断升级,还可以不断的进化…… 男护士转生异世界,竟然被职业评定选择成了最稀有职业-男性圣职者?本来以为可以在异界享受人生,迎娶公主,走上巅峰,没想到卷王居然就在我身边?内卷什么的之前已经受够了!为了对抗内卷,全都点了治愈,男圣职者平凡而又非凡的异世界生活,从现在开始!
中国工控网络安全危机 快速网络营销费用 互联网信息安全的解决最终还是要 企业信息安全的定义 四川省信息安全基金 推广类网站 病毒营销缺点 .网站排版 乌海网站建设 网络营销网址 专业网站设计建站 首席信息安全官 改图网站 分析亚马逊营销的特点 快速网络营销费用 计算机信息安全保护等级 专业网站设计哪家好 企业信息安全的定义 推广类网站 公司信息安全管理办法 营销学评价 网络营销实用教材 的教材框架是基于何种营销理念编写的 社会 信息安全意识 信息安全就业好吗 对信息安全技术的理解 对信息安全技术的理解 网站 托管 更新网站内容有什么用 重庆整合营销那家好南京网站公司 浙江省 网络安全 专业的外贸网站 2017中国网络安全峰会 web网站设计的 资讯网站排版 大数据网络安全专业版 中国工控网络安全危机 网络安全检查工具 网络营销网址 什么是口碑营销 企业信息安全的定义