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
网络安全产品选型企业网站网络营销方法公安部信息安全保密法2015首都网络安全日网络营销专业长沙微网站电话号码asp网站制作中央 信息安全工作会议网络安全防护软件营销会员信息安全标准网络安全红蓝对抗互联网 与传统营销区别营销案例信息安全和管理自已建网站信息安全和管理中心地址,-1中小企业互联网营销策略研究现状网络营销工具的概念对信息系统运营 使用单位的信息安全等级保护工作情况进行检查公安网络安全考试网站 体系深圳网站外包深圳网站外包1、大型门户网站服务功能邵阳网站优化南京网站建设哪家专业西安做网站的网站设计软件济南做网站公司有哪些网站上线上古世界,神魔共舞,凶兽横行,修士纵横…… 这一切终归跳不出天道法则的支配。 净世法则之下,一切皆归虚无。 毁灭不过一瞬间,重塑辉煌却需无数岁月。 天道崩灭,推倒重塑,谁甘心再入轮回! 诸天万界,仙古苍穹,帝者不过十人。本是先天剑体,天纵骄子,却惨遭陷害,葬剑百年。 我姜北玄修剑证道,不为别人,只为心中执念,剑气乾坤诸天,一剑苍穹万界——北玄之下再无剑帝。 母亲病故后,孑然一身的徐达开始酗酒、赌博、呷妓,每天浑浑噩噩的活像一头行尸。他不明白人为什么要活着?或者说他在为什么活着?当徐达渐渐陷入恶臭的泥沼时,他突然开始后悔没有听母亲的话。百般挣扎无望后,一个完全长在徐达审美上的女人出现,冰冷的丢出两个选择。石小方是个很方正死板的人,说了不能妥协就是不能,说了不能少泡一个就是不能,一直以自己所能想到的各种无耻借口做着方正而死板的自己。但是现在的他很方,他只是个打算如方石一般横扫过人生这个终将有终点的大滑坡,怎么突然就告诉他,这个滑坡之下,是修真界这片汪洋大海呢? 俗世百年,我的钱呢?我的妞呢?我的七情六欲,你一片海就要我全丢了,去做你的定海神石?想得美呢吧老头子们!青春回忆类型。想写给一个自己暗恋过的女孩子。别人穿越都是自带老爷爷和系统外挂。 而武神王历穿越后却成了一具最低等的召唤骷髅。 王历无语问苍天。 发育畸形也就忍了,为啥自己的主人看起来还不咋聪明的样子。 别的召唤兽都是被召唤师精心培养,而王历却要精心培养自己的召唤师。 常言道,女召唤师和女司机难养也。 要把她培养成真正的主角,任重道远啊。当幽蓝的火焰降临世界,世间所有的罪恶当得到审判。 PS:小说只是借助海贼世界故事背景再次创作,很多剧情并不根据原著走,很多情节也是我根据原著所做的推导,后期可能会偏向玄幻! 不喜勿喷!谢谢!世纪系统,一个控制无数世界的完全潜行程序。由自称先驱者的神庭议会所创造,用于控制宇宙间物质与能量的转化。被称为天父的男人是议会中最不合群的一个,但掌握了更多的系统权限与绝密资料。天父创造了十二个维护者用于协助自己对世纪系统进行相应的修复与优化,其中最后诞生的维护者不像其哥哥姐姐,仅由编号来命名他,似乎是为了躲避某种系统机制。虚数空间对现象世界进行侵入时展现出世纪系统的弊端,大量的错误信息覆写了大量的命运模块数据。世界陷入混乱。天父遇刺死于系统大厅,指挥十二维护者的重任压在长子——普罗米修斯身上。大部分的维护者都被派往虚数空间镇压混乱,直到连长子也被虚数空间混乱的能量所侵蚀陷入癫狂,最终被十二封印在第一宇宙世界。十二对神庭议会进行了大清洗,铲除内奸,尝试独自修复这个已经癫狂的世界,强制将系统进化成新的形态。世界末日,天地巨变。秋百川是一个在末日求生残废,机缘巧合下踏入修行之路,修复肉身,斩灭强敌。建立馍教,盐王府,构建和谐社会创造理想家园这是个修行琴棋书画就能够获得文气,修炼文道的世界。 在这里挥笔可化万千利剑,杀人无形,弹琴可化天地大道,镇压万世。 读书人口诛笔伐,可化唇枪舌剑,以画勾勒诸天万道。 秦尘心言出法随,才气化剑,笔化龙蛇,开口便是天地规则。 我携三千诗书,可练就无上文道,成就万古圣人。
网站制作的趋势 互联网 与传统营销区别 asp网站制作 青岛做网站建设的公司 1、大型门户网站服务功能 信息安全等级保护评估 营销团购 公司网络安全通知 点墨网站 江苏省网络安全和信息化 北京网站优化公司 北京网络安全公司排名 b2b门户网站运营策划:循序渐进增加内容——运营时的关键点 长安网站建设多少钱 公安网络安全部门 网站设计文案 公司网络安全规范 移动 营销 公司网站开发公司 网站开发与网站制作 营销推广的方式 购物网站常用功能模块介绍 网络营销涉及哪些方面 信息安全和管理中心地址,-1 浦东企业网站建设 开网站公司 网络安全及解决方法 设计网站的元素 病毒营销的一般规律 昆明网络营销实战培训 棕色网站 网络营销实战课程总结 3合一网站 信息安全的公司 网络信息安全好学吗 营销型网站推广方式的论文 网络信息安全素养 盈利网站 1、大型门户网站服务功能 网络信息安全 规范,-1