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
信息安全牛商网数字营销哪里有网络营销理论分析王老吉的营销网络视频营销营销组合的4papp和微网站的区别网络黑客与网络安全浅谈成功修改网站关键词的方法 虽然我们在做网站之前都会再三奥门网站建设邯郸做网站网络安全策划浏览器合作营销方案互联网平台信息安全太原网站建设培训学校网络安全博士信息安全等级保护二级,-1网络安全策划网站模块风格网站微网站内页网站辅导运营与托管公司广州优质网络推广营销方案专业企业网站建设公司邯郸做网站信息安全最关键也是最薄弱营销推广活动主要有哪些信息安全技术云计算信息安全等级保护测评要求云计算信息安全等级保护测评要求我是一个理科生,文科也贼六,我穿越到了东汉,没有砍不死系统加成,没有武魂、灵根、法力、家族势力…没有任何金手指,没遇到刘备,没遇到曹操,落地扬州也没遇到孙家,什么都没有…只靠学到的东西在东汉末年活下去……观某的东汉求生记两炎黄子孙。 网吧猝死。 魂穿神狼。 身负系统。 一者升级系统。 一者万能系统。 原是铁哥们。 今成双父子。 一为帝。 一为帝他爹。 帝坑爹变强。 爹纳妃三千无敌。 二人相坑相杀。 面对强敌。 哪怕万级大佬。 莫慌。 有爹在。 都是阿猫阿狗。 本书有些无厘头,偏搞笑。 开车~ 你懂的。 还不懂? 给你个表情自己体会。 ヽ(爱′?‘爱)ノ 懦弱、胆小、霸凌是我经常遇见的,为了改变我努力习武,日复一日年复一年,坚持与毅力共存知行合一。做一件事要认认真真的去完成,你要做到一往无前,不畏艰险打破一切困难! 且看怂包少年偶得系统开启武学之路拳震八方,成就无双威名! 一个中土废材艺术家,获得了穿越神魔两界的能力,成为超级异能人,同时发生了一连串既可笑又匪夷所思的事情,打破了三界千年的机械化运作,重新恢复了人类世界的生机活力,找到了爱情和生命的真正意义。五年前,一心沉迷于武侠梦与仙游的他,高考名落孙山,一次与少林的邂逅,成就了五年后身怀绝技的少林俗家弟子,在这个现代文明的暗黑江湖,他身怀绝技,更也柔情似水,怀揣着武侠梦,收服恶势力,成就小人物的一番霸业。暗黑世界,儿女柔情,铁汉硬血,看混世小武僧如何成就雄霸伟业。魂穿古代的陆子铭师承当世第一大派天剑山,好不容易逃出山门本想大展一番拳脚的他却意外的发现自己干啥啥不行,白嫖第一名。 于是在机缘巧合之下直接当起了一名乞丐,想凭借自己逆天的颜值将白嫖事业发扬光大。 哪曾想却意外卷入到了各种江湖厮杀,朝堂诡谲的阴谋算计之中。 “这位小娘子,本人只讨钱,不要饭!” “你可以拿钱羞辱我,但不能拿残羹冷炙侮辱我!” “什么?你才有病!你全家都有大病!” “tui,小娘皮长得怪带劲,就是素质低了些,脑袋也有些问题!”宋世在机缘巧合之下来到了一个光怪陆离的世界,与他同来的还有一个神秘系统,在系统之中只要存在的功法武技,都能通过贡献点获得。 宋世:那岂不是游戏中那些屌炸酷炫的技能也行? 狂风绝息斩、瞬狱影杀阵……诸如此类的武技竟然还能随着宋世系统的升级而升级。 在修真时代,看宋世以另类的武技功法征服各个世界……混沌初开天道始,万族林立生者适。天道如海唤天堑,踏海征途道之巅。 ——洛尘兮 世间万物皆修行,道俱万千谁能赢。百花齐放争天地,唯有强者动乾坤。 ——黄梦燃 天堑海之巅,道祖洛尘兮与仙祖黄梦燃为道统之争一决胜负。最终洛尘兮技高一筹,将黄梦燃打下天堑海之下。自此天堑海上再无仙祖黄梦燃之威名,殊不知这只是黄梦燃借此达到他计划的第一步——重生!每个人心中都有一个自己的江湖,江湖故事。 凌云被师傅赶下山,一人独闯江湖。 江湖纷争,人心难测,我自清醒。 约尔:先生我们的飞船已经离开本宇宙了。 男子:好的,我们继续航行。 约尔:了解,先生。但是不唤醒佳爱琉没问题吗? 男子:我是故意把她留下来的。等她醒了之后会追上我们的。 约尔:明白,先生。 ........七年之后 约尔:先生我们到达新宇宙了,根据检测这里是一个魔法宇宙。 男子:传说中的魔法宇宙吗,找个世界降落吧。 约尔:好的,先生。
邯郸做网站 营销组合的4p 信息安全技能培训 wannacry 网络安全 网络安全日 队伍 东软集团网络安全产品 网站制作 常见问题 湖南微网站营销 济南网站建设公 旅行行业网络营销策划 扁平式网站 中国信息安全实验室 长春给企业做网站的公司 邯郸做网站 营销的成都网站优化 优秀网站欣赏 中国信息安全实验室 主要有哪些信息安全技术 手机网站广告 营销的分类 注册网站的免费网址是什么 计算机信息安全产品 客户短信营销 网站制作 常见问题 网站制作 广州 网络安全等级测评 网络安全日 队伍 简述网络营销的4c策略 淄博网站制作设计 澳大利亚信息安全专业排名 青岛商业网站建设 中国信息安全认证 成都营销 信息安全架构优化 病毒性营销特征 网站虚拟主持 整合营销传播特点 网络安全博士 风格网站 成都营销