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
网游重生之邪骑传说txt下载仙路争锋txt网游重生之邪骑传说txt下载一路高升txt篡唐txt全集下载物质生活txt弃女逆天腹黑太子妃txt下载将军在上我在下txt新浪淑女如云txt下载莺莺传 txt末世之恐怖风暴txt全集下载网游重生之邪骑传说txt下载武魔破天txt心坟txt下载将军在上我在下txt新浪莺莺传 txt天命新娘txt新浪薛家兄弟的玩具txt薛家兄弟的玩具txt牧野诡事txt下载我的故乡在八十年代 txt薛家兄弟的玩具txt淑女如云txt下载久违军人先生txt篡唐txt全集下载龙一小说txt一路高升txt久违军人先生txt牧野诡事txt下载武魔破天txt在一个平平无奇的一天,一个高中生被某种神秘的力量拖进了一个充满危险气息的腐败世界。幸运与不幸,冥冥之中自有定数。幸运也好,不幸也罢,既然来到了这世间,怎么也得好好看看,这是个怎样的世界!神圣再现,风云再起,旧时代未葬下的魔,就由我来终结。(作者是个小白,文笔不好!)(带修为归来,无敌+单女主+奶爸+萌娃+战斗+微搞笑+甜蜜。) 他,曾是一代雇佣兵王,后退役成为顶级杀手组织“暗暮”王牌杀手! 却不想,竟遭人算计,背叛;一番血战中,寡不敌众的他被子弹贯穿了胸膛,坠落悬崖…… 却不想,意外开启了进入天界的入口,并在机遇下获得了一部功法…… 之后,他游走于六界之内,纵横于多元宇宙之间;凌驾于天地之上,视众生灵如草芥。 纵然屠尽六界神魔,天道也奈何他不得…… 五百年后,他再度归来,却不想,此刻的他,竟有了……两个可爱的女儿?! 错了,重来…… 那纵横于多元宇宙,凌驾于天地之上的恐怖存在,摇身变成了一名……柔情奶爸! “敢欺负我女儿,定让你消失于六界之内!” “你……你到底是谁?!” “我吗?有人叫我武龙帝尊,有人叫我武龙天尊,还有人叫我混沌天帝。” “但我现在,只是一名安静的女儿奴。”“呐,呐,你的异能是什么?” “明明知道自己要付出的代价,为什么还要用,真是个笨蛋!” “指令:控制!” “就算是锋利的东西,也是可以守护好想守护的。” “绽放吧,红莲!” “这次轮到我保护你了。” “接下来就交给姐姐我吧!” “从拿起刀的那一刻起,你已经输了。”他身穿孝服跪在灵堂,逝者不是双亲,而是自己素未谋面的公主老婆。 看着灵堂上的牌位,遥想着接下来依制守孝的三年。“作为穿越者,我还没开始规划起飞,就要躺平了么?”羊庄悲愤地想着五年前,因为一场陷害,震惊江城的一件事情,我离开了这从小到底都在这里生活的地方。 五年后,我成为了战神,创立战神殿,独立边境震慑诸国,满身荣耀的回去寻找那对我做梦都想去弥补的妻女。主人公,王程凡无意中得到一个最强宠物,进入异世界开始他的宠物进化人生修炼世界,没有正邪善恶,只有弱肉强食! 楚天,从乡野走出,机缘巧合之下,踏上了一条霸世称尊之路!淮南大学历史系研究生许攸因意外卷入命案,与刑警支队队长喻归远相识,旧案未破,新案叠出,性格迥异的两人也在案件的不断侦破下,从初识的看不惯到彼此理解,成为惺惺相惜的挚交。
猎魔夜人 幸存者的獠牙 禁忌剑仙 我真没想当男主啊 从纨绔开始 黑色乐园 路走尽了怎么办 无:我也不知道在写什么! 他们修仙那我开挂! 荒野大镖客之死亡救赎 悍浪啸苍穹 异世界的传奇之旅 壶内老婆已满 ,派蒙禁入! 灵珏点将录 修仙犯法么 梦尽星河 蜀山签到三千年,出关陆地剑仙 黄昏芝初 天机十八策 小神医之灵瞳 重生三国之公子刘琦 txt 重生之花都寻芳记txt 天命新娘txt新浪 篡唐txt全集下载 重生三国之公子刘琦 txt 穿越到明朝做王妃txt 迷天txt下载 春秋我为王txt下载 龙一小说txt 武魔破天txt 淑女如云txt下载 重生之宋武大帝txt全集下载 衣冠楚楚 读读txt 重生之花都寻芳记txt 物质生活txt 篡唐txt全集下载 迷天txt下载 龙一小说txt 我的故乡在八十年代 txt 网游重生之邪骑传说txt下载 重生之花都寻芳记txt 将军在上我在下txt新浪 仙路争锋txt 心坟txt下载 莺莺传 txt 衣冠楚楚 读读txt 龙一小说txt 仙路争锋txt 我的故乡在八十年代 txt 龙一小说txt 篡唐txt全集下载 重生之花都寻芳记txt 带着金庸武秘一统三国 txt 物质生活txt 久违军人先生txt 篡唐txt全集下载 带着金庸武秘一统三国 txt 天命新娘txt新浪 衣冠楚楚 读读txt 将军在上我在下txt新浪 一路高升txt 徒然草 txt 百度云 五代逆天txt 重生之宋武大帝txt全集下载 心坟txt下载 重生之花都寻芳记txt 重生之宋武大帝txt全集下载 一路高升txt 衣冠楚楚 读读txt 弃女逆天腹黑太子妃txt下载 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 我真的很稳健啊 全球冰封:我为人族守护神 逍遥小里正 丧尸海豹突击队队长 我去系统,你坑我 快连下载 亚星管理平台 亚星游戏官网 快连下载 亚星管理平台 穿越到明朝做王妃txt 网游重生之邪骑传说txt下载 我的故乡在八十年代 txt 心坟txt下载 牧野诡事txt下载 魔王的男人txt新浪 魔王的男人txt新浪 网游重生之邪骑传说txt下载 网游重生之邪骑传说txt下载 衣冠楚楚 读读txt 薛家兄弟的玩具txt 将军在上我在下txt新浪 武魔破天txt 重生之宋武大帝txt全集下载 牧野诡事txt下载 一路高升txt 天命新娘txt新浪 物质生活txt 我的故乡在八十年代 txt 牧野诡事txt下载 衣冠楚楚 读读txt 武魔破天txt 武魔破天txt 物质生活txt 物质生活txt 久违军人先生txt 衣冠楚楚 读读txt 将军在上我在下txt新浪 一路高升txt 重生之花都寻芳记txt