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
电影人民公厕半支烟完整版电影老电影江水滔滔电影无影有关电影电影《龙猫》的歌曲电影人民公厕电影鬼赌神老电影江水滔滔受益匪浅的电影下载抗战电影叶子卿电影全集老电影江水滔滔老电影战上海歌曲叶子卿电影全集电影江水滔滔下载抗战电影潘长江抗战喜剧电影angelababy彭于晏电影angelababy彭于晏电影1看电影官方下载早霜电影下载angelababy彭于晏电影受益匪浅的电影电影夏日神没有共产党就没有新中国电影夫妻性爱电影大全没有共产党就没有新中国电影电影夏日神1看电影官方下载老电影战上海歌曲前世顶级杀手转生异界骷髅?! 诡异书页 ,神秘纹路,脑中突然出现的那是什么... 隐秘如一团团迷雾笼罩。 前所未有的异界大陆,阿尔伯特睁开了眼睛。 ”我的士兵,帮助你们的王铲除掉来犯的蝼蚁!” “你管眼前这个叫蝼蚁?!” 阿尔伯特的异界冒险,开始了!虚拟现实游戏《冷兵器时代》发售,它硬核的游戏设计和相当于现实中地球3倍体积的世界,让它在发售之前就受到了全民的追捧。 当然,地球共和国亚洲区公民朱天云作为一名历史扮演爱好者和历史爱好者,也是毫不犹豫的预定了一台机器,成为了这个世界中的穆拉多伯爵。然而,一个可怕的阴谋,就十分不起眼的隐藏着在这个制作精良的游戏中。 号角震天,群鸦蔽日,军旗招展,长矛林立。 漫天黄沙之中的古拉姆奴隶战士、武艺高强的军事修会骑士、东方草原上弯弓射雕的勇士、寒冷的北国土地上踏着整齐的步伐,昂首挺胸向着前方缓缓推进的重装步兵……战乱不断,血洒战场! 贵族们的尔虞我诈,针锋相对;百姓们的生活不易,民不聊生;士兵们对受封田产、带着累累的战功和数目令人眼红的战利品解甲归田、儿孙满堂、不愁吃喝的美好盼望……一个有血有肉的世界,等待您的探索! 慢热,永不收费,主角会以一个普通人的方式进入游戏,没有不同于他人的方面(包括系统,运气等)某个现代一个神秘的少年韩霄被一个神秘的世界穿越到武朝时代,但他来到末曾见过一个不一样的古代世界里。 他帮助武朝完成统一,实现了他未曾相识的世界。【无系统】【传统玄幻】【权谋争霸】【屠神以正天道】 我从血月之夜杀出,本想安稳度日,并无登天之志。 但奈何, 圣皇说:你活着就是原罪!就地伏诛! 仙人说:你活着就是原罪!请君以死赎罪! 古神说:你活着就是原罪!灭世大劫,因你而起! 既如此,我李不器便只能持刀向前,灭圣皇、斩仙人、屠尽诸天古神,还这世间一个朗朗乾坤!我自凡俗来,还向红尘去,三个麻钱走天下,一本经书读一生。能与贩夫走卒畅聊,也敢面淬将相公卿,在乡野山村,我自活得逍遥,于繁华都市,亦能不弱于人,不求仙道,不念长生,不想显达,不盼成功。听老人讲民间故事奇闻杂谈惊悚传说还有最终结果男主魏羽泽前世是一名科学家,因一次意外实验穿越到一个叫玄气的世界。这里的人都会修炼一种叫玄气的东西。男主重生在这个世界,恰巧碰到战争,男主会有什么奇妙的经历呢?从小我就生活在一个寒冷,异兽侵袭,见不到光亮的世界,而村子里的人也越来越少,直到一天村长爷爷给了我一块石头.... 牡小夜:黑夜给了我黑色的眼睛,我却用它寻找光明。 牡小雨:哥哥说过,人间没有永恒的夜晚,世界没有永恒的冬天。远古人类探索,揭秘古老遥远的史前世界!【原神同人作品,非后宫,非无敌,或许会有小刀刀】 高崖上,少年面色一冷,面对着敌人,冷冷的开口。 “尔等,也想见识一下吾之永恒吗?” 没等前方领头的男人开口,只听少年低吟道 “无念,断绝!”
我有超能力之通天炎武 蛹变z 元宇宙:重生进化路 有请领主大人 我自异世而来 渡劫飞升 绸古 凹凸CP故事集 关于重生后的老婆嫌弃我是个穷鬼这件事 到了异世界也依旧没有干劲 当我成为李信 至尊成魔 帝国路 被迫成为副本boss 起灵之末日 汇龙潭 原来我真是世外高人 灵气剑师 三国:满朝文武全是穿越者 白骨巡天记 电影麻姑什么意思 虎虎虎电影在线观看 潘长江抗战喜剧电影 有关电影电影《龙猫》的歌曲 电影麻姑什么意思 一个小孩划船的老电影 潘长江抗战喜剧电影 二战战争片大全电影一 夫妻性爱电影大全 老中国战争片大全电影片 十年计划电影的男主角 十年计划电影的男主角 急速蜗牛八哥电影 虎虎虎电影在线观看 电影人民公厕 有关电影电影《龙猫》的歌曲 生死地松泸会战电影 夫妻性爱电影大全 韩国电影后宫之妾 老电影江水滔滔 虎虎虎电影在线观看 电影江水滔滔 韩国电影后宫之妾 叶子卿电影全集 下载抗战电影 急速蜗牛八哥电影 电影麻姑什么意思 半支烟完整版电影 韩国电影后宫之妾 夫妻性爱电影大全 有关电影电影《龙猫》的歌曲 zhanzheng电影网 电影无影 电影人民公厕 电影夏日神 没有共产党就没有新中国电影 电影无影 潘长江抗战喜剧电影 急速蜗牛八哥电影 电影江水滔滔 没有共产党就没有新中国电影 老中国战争片大全电影片 兰博 电影 生死地松泸会战电影 叶子卿电影全集 zhanzheng电影网 十年计划电影的男主角 没有共产党就没有新中国电影 急速蜗牛八哥电影 电影鬼赌神 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 虚梦记 夜楼鬼影惊魂梦 我在大荒炼体成仙 隋唐生活启示录 小农村的离奇故事 亚星管理平台 澳门葡京官网 葡京官网 亚星管理平台 万利游戏官网 虎虎虎电影在线观看 半支烟完整版电影 老电影江水滔滔 电影无影 电影江水滔滔 夫妻性爱电影大全 老电影战上海歌曲 生死地松泸会战电影 一个小孩划船的老电影 急速蜗牛八哥电影 一个小孩划船的老电影 zhanzheng电影网 电影夏日神 兰博 电影 兰博 电影 半支烟完整版电影 受益匪浅的电影 1看电影官方下载 叶子卿电影全集 下载抗战电影 虎虎虎电影在线观看 老电影江水滔滔 受益匪浅的电影 电影麻姑什么意思 电影江水滔滔 电影无影 老电影江水滔滔 电影鬼赌神 电影无影 angelababy彭于晏电影