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五彩斑斓的背后总是深邃的黑……马克?李,无论干掉你的是谁,我都会为你报仇,以告慰你在天之灵。 注①:第一次写文,用的是第一人称,慎入。 注②:因为是同一个作者写的, 所以这篇也能在话本小说(如果有更多 人支持的话将来可能会在B站?)找到。 注③:作者是学生党,随缘更新。【千术】+【悬疑】+【腹黑】 我出生千门,千门分八将,上八将和下八将,上八将才是千门正统,手法高明,多方配合,讲究‘术法’,下八将最为让人不齿,没有高明手段,只能坑蒙拐骗,坏事做尽。 我的叔叔是正统的千门正将,我和他学了很多手段,但十赌九亡,在我而立之年,因为千术而进去了,整日唱铁窗泪,现在我弃暗投明,想给大家讲讲我曾经的故事,起到一些警示作用……一个持续万余年的计划 只为对抗 第一圣人毁灭世界的阴谋 却不想其他世界的误入 让整个行动造成了无法挽回的偏差 是绝地重生? 还是陷入绝望…… 【女帝】、【脑洞】、【搞笑】 一位普通的网文读者云逸,穿越到了看似平常的异世界。 熟读套路的他,开局就抄了前世的一本经典仙侠小说,想要通过网文赚取第一桶金。 但没想到。 这个世界,正处于灵气复苏不久,修行之法还未开创的时代。 所以,当云逸小说火起来的同时,一部分人发现... 小说里的修行功法、锻器手段、炼丹丹方,竟真的全部可以模仿使用! 此刻,全球震惊,各国开始紧急接触云逸! “仙帝无私奉献,哪怕是圣品功法也未曾藏私,令人钦佩!”有人族修士恭敬道。 “师父悉心教导,润物细无声,让我受益匪浅。”女帝徒弟言笑晏晏。 “仙帝一剑斩妖,救人族于水火,此等胸怀,我难以企及!”有人族大能跪拜。 自此,云逸被全球的修行者们尊为“开天地新生,创万界新道”的原初仙帝。清纯未婚妻,腹黑小姨子,性感女刺客都别来找我啦!我还得努力修仙呢!某天,矗立于宇宙之巅的斗篷大帝看向万亿光年之外的蓝色星球,看到了自己童年,如今斗篷大帝已是宇宙第一人,一指平息宇宙各位面无数战乱,一掌将M78与西天世界毁灭得一干二净,如今他累了,他想回到家里,重新开始另一故事线,一个真正属于他自己的故事,弹指间,只见他化作星光消散于宇 宙之中,留下一段流传万古的话: “体彩之巅,乐透为王, 机选之中唤吾名,反可中大奖! 吾名: 斗篷大帝!!! 吾生于乱世之中,手握日月星辰, 一指平万世之乱,一掌覆灭西天, 纵观万古无数神帝,唯吾一人称大帝尊!” “纵横宇宙之间,傲世万重之天, 唯我斗篷大帝一人独霸神道!!!” 剑足够利,拳头足够大,才是真正的道理…… 方酒本是清苦知足,乐活安稳的一名少年,没有雄心野心,没有凌云之志。然而江湖上哪有什么真正的安稳。 风云难测,人心更是诡变。江湖险恶,三擎百教林立,有人径来直去,有人心术权谋。赤子少年如何在纷争中挣扎,是泯然众人,还是一步登天。 诸君,且观风云。小说以多个单元故事呈现给读者,欢迎大家阅读。我和几个兄弟喝醉后醒来竟然穿越到别的世界,真尼玛离谱李长歌穿越了。 开局家徒四壁,一贫如洗。 只有一个相依为命的姐姐。 好在这是一个“小说家”的世界。 在这个世界,只要写小说,便能获得非凡的力量,甚至能够依靠小说成圣! 看着这个世界普遍流传的小说著作,李长歌表示就这啊? 《神雕》出世,“侠之大者,为国为民”被千万人追捧! 《三国》出世,无数谋臣直呼原来计谋还能这样玩?! 《西游》出世,无数人惊叹天庭是不是真的存在! 《水浒》出世,就连皇帝也坐不住了! …… 某一天深夜,李长歌看着身边美貌温婉、娇艳无俦的李采薇,义正辞严的道:“姐姐请自重,我要写小说了!”
一介布衣 冥王殿! 一剑封情 剑指神明 我的地球是个废材! 北山 王臣 天纪:靖帝本纪 僵尸狂徒 玄幻:我是气运大反派 铁血狂徒之呆妹淑怡是我妻 超级人工智能 奥特幻想之异世界乱入 短刀狂歌行 不灭造化决 我的系统被世界截胡了 武道宗师:模拟修炼系统 陆地剑仙:剑阁守剑八十年 我的兄弟是战神 他来自蛮荒 W语言 欢喜胭脂铺全文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 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 剑尊他一穷二白 天下至武 十亿年生人生 我真没想当训练家啊 穿越:开局落凤床 万利官网 皇冠登3出租 百家乐官网 万利官网 欧博官网 逍遥神农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下载