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  李乘风穿越到一个妖魔横行的世界,成为青城山的一个守山人。   奈何他没有灵根无法修炼,只能安安分分做一个普通人。   但是有一天,他的系统突然变异了,从此成了一个令一众妖魔闻风丧胆的得道高人……   这妖怪也太弱了,我都没有出剑呢,怎么就死了。   我养的一条狗,居然是横扫妖界的一方妖王。   我池塘里的乌龟,竟然蜕变成了洪荒神兽。   之前跟我下棋的老头子,最后竟然成仙了。   还有那个最喜欢听他吟诗作对的漂亮姐姐居然修仙界第?仙?。   知道这些真相之后,李乘风开始怀疑人生:   我该不会真成为绝世高手了吧? 深夜的酒馆,推杯换盏 和你喝酒的,究竟是人是鬼 没有归宿的灵魂啊 在这里,你将得到救赎坐胯守元,练就不朽神话; 天地无极,怎奈我赤子之心; 诸天万界,定当逍遥!重生丧尸即将来袭: “杨老板,您购买的十吨大米到了!还有五吨的小米,三吨黄豆……” ?“杨老板,您订购的一吨牛肉,和一顿猪肉,还有……鸡肉,鸭肉,都到了!” “杨老板,您加急订购的防弹玻璃,还有钢化门,还有加大款的太阳能发电板……已经全部运送到了。”? ?一群穿着防护服的人到了学校,给每一个学生打了一针陨石中的液体。在之后全球又发生了一系列怪事等等从末日十年之后穿越而来,比别人领先了十年!但由于江北辰的复活,丧尸也加速了进化!看我如何在这个混乱的时代站上巅峰。楚林重生穿越到一个未知的修仙世界。 武功尽失、曾被称为“奇才少年”的他跌落神坛。 正当楚林痛饮美酒,卧床难安时,他居然又跑回现实了。 从此获得:驾驭现世与修仙世界! 某天公司举办Cosplay展览会,楚林意外遇见一名古装女子。 她窈窕妩媚,柔桡轻曼,冰肌莹彻,两眼流苏像极了制作游戏里的人物。 “凛秋雪,这个家伙居然也跑到现实了!” 楚林不敢置信地抓住她的皓腕,只见凛秋雪铁青着脸。 “流氓!” 一次意外,带来的改变人生轨迹,从此开始了,不一样的人天地百变,万物生长,道路漫漫。东晋末年,神州陆沉,南北分裂,在这个遍地腥膻,豺狼虎豹横行的乱世中, 他应运而生,挺身而出! 他驱除胡虏,恢复中华,立纲陈纪,救济斯民!百万大军阵前,他临危不惧,面不改色; 士族门阀面前,他八面玲珑,从不妥协; 而对于地位低下的黎民百姓,他反而秋毫无犯,爱民如子。 他就是东晋最后一个军阀,徐骁,徐宗文。 且看他在晋末这片乱世中如何叱咤风云,纵横捭阖?
封神:我,人皇帝师,摆下先天杀阵 九荒天庭 成仙之前 屹立高墙之下 从制作游戏开始成为首富 学霸异世界修仙之旅 鸿轩记 仙垂死,我的妖父不容我 突破云霄 吾剑永恒 华夏巅峰崛起 星际镖师 他老人家的小祖宗 神王太古 都市亦邪 现代修真视录 在打牌的世界散播致郁 都市奇门怪医 乡村公子 魔法世界的修仙者 凤游天下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 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 至尊小仙农 血染轮回:护你成帝 西游之通天大圣 龙女山传奇 末日转职 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 杀手相公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下载书包网