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
水手服漫画图片七龙珠18号 龟仙人漫画水手服漫画图片一方美琴漫画微热漫画图片蜘蛛侠r18漫画有什么总裁型的漫画少女校园爱情漫画大全美国最有名的漫画公司日本少女福利肉番漫画一部关于登山者的漫画水手服漫画图片日本最著名的少女漫画肉漫库工口少女漫画少女校园爱情漫画大全日本少女福利肉番漫画早介作者的漫画妖精标本漫画妖精标本漫画手绘漫画男主桐人和亚斯纳邪恶漫画妖精标本漫画美国最有名的漫画公司死囚乐园对应漫画微热漫画图片朱宇辰的所有漫画一方美琴漫画死囚乐园对应漫画手绘漫画男主日本最著名的少女漫画 封林是一个在北京潘家园旧货市场开旧物店的小老板,一次在给店里的老房屋装修的机会,竟然在家里墙壁地下暗格发现一个密室,不太大的密室角落里有着一口上了锁的红色的木箱子,盒子打开后里面有着几样东西,一块巴掌大纯金的腰牌。 一本非常破旧的遁甲巫术古书, 还有着一本记录了很多秘事的明朝古书,还有一张残缺不全的地图,箱子里面藏着很多的秘密,让他知道了自己的家族竟然是一个传奇盗墓家族的后人 从古至今的家族秘密缓缓的被揭开,父亲的突然消失,也与此事有关,是为了寻找哪些传说中的东西。 自己兄弟的回归,退役特种兵赵雷,去追寻着父亲的脚步去寻找那传说中的古遗迹,不得不踏入那些恐怖之地。 入活人的禁区,与僵尸斗法,与活人斗智,有一张尸面的鬼狐仙,荒冢野坟墓里的媚女,害人的白皮千年老狸子,披着美女人皮的行尸走肉,几十年难得一见沉没在海里的幽灵鬼船。 一张残破不全的地图,一截刻满符文的龙骨,到底藏着什么秘密? 路上碰到个老神仙非说要给我算命,最后说我五行俱全不适合这个世界,没多久,精神病院的人把他抓了回去,然而我果真如同那精神病所说,我,不适合这个世界,在他被抓没几分钟,我就穿越到了这阴阳五行世界,这里总该是属于我的世界了吧,我,莯灿鑫,将在这个世界留下我的故事!冯宇熙生活在精灵世界,这里有各种神奇的精灵,等你来收服何为末世?丧尸?魔怪?虫族?不!唯有当人类所恐惧的,所崇拜的,甚至是所幻想的一切都成为现实之时,才是人类真正的末日!灵气回涌,信仰重铸,这是神佛妖魔的饕餮盛宴,也是人类有史以来的最大浩劫!丧尸,异形,贞子,怪形,妖精鬼怪,神魔仙佛,这一切的一切,都将降临于世!这是真正的末日,这是末世……神魔纪元!——————这是不冷的第四本书,已完本三本共1500W字小说,无太监,人品保证,新书期急求支持!加更规则:打赏满100加更一章,鲜花满1000加更一章,加更的章节会在上架后爆发!一个失去父母依靠的少年黑娃,在深市的闯荡中,引来了一群形形色色的少年,并借助多年的苦难积累和异能,智慧和斗志,最终成为了都市神少。君若离去,我必生死相随,来生再相依相爱,这是一个悲惨的故事,主角上官云飞幼小父母双亡,家族毁灭。在叔叔的照看一直一路崛起,你以为他会一路高歌,却没有想到天有不测风云,主角遭受挚爱背叛,从此一撅不振……这个世界有鬼,地府鬼仙,有神,天庭神仙,有灵,人间神灵,有妖,上古妖兽,有佛,诸天神佛,有道,无上道尊,有国,大汉。 身为游戏霸主的李清风,来到这个世界,本想做一个潇洒快活的江湖侠客 囚牢内的一封密函,彻底改变了他的思想,从此在一个名叫“权利”的旋涡内越陷越深“我可是读书人,读春秋的,才不是什么粗鄙武夫。” 苏羽认真的说道。“乱世枭雄争锋来,此乃大海贼时代!”神话仙武版海贼王的故事,魔改剧情,慢热,多铺垫伏笔,有大量自己的情节,也有原著的时间线,完整多体系,逻辑严谨,带你领略仙武海贼江湖的冒险故事,在重重迷雾中找寻历史的真相,争夺气运,问鼎独道之神!神皇无道,天下共伐之! 伐天盟无数修士封印神皇于混沌烘炉,七日炼化,神皇必死! 叶枫:这都特喵大结局了,让我穿越到被干倒的反派BOSS身上干嘛? 哦,原来是有人生编辑系统,这下你们在神皇身上受到的委屈,压迫,我都可以解释了,笔来! 我要让全天下人都知道,神皇不是反派,更不该死,是全天下都误会神皇了! 整个天下,都欠我一条命! 全天下人,都欠我一声对不起!
博士重生之复仇 山狼 第一纨绔:我爹陪我穿古代 我的世界元素大陆 那年鸣潮那些事儿 和校花妹妹同居的日子 凌云破空 TFL36的使命 风一样的人生 天汉风云传奇 群穿明末之荒海平波纪 贰拾玖楼 傲曲武神 樱花树下的罪恶 咸鱼进化 净身出户的我火爆娱乐圈 女装大佬的我混的风生水起 我在晚明替天行道 书凡 神秘的小葫芦 七龙珠全套漫画 乙女 漫画 r18 早介作者的漫画 微热漫画图片 七龙珠全套漫画 乾x海棠漫画 圣痕炼金士 漫画 下载 日本邪恶少女漫画h里 朱宇辰的所有漫画 日本最著名的少女漫画 美国最有名的漫画公司 这不是dota漫画78 同学自相残杀的漫画 乙女 漫画 r18 蜘蛛侠r18漫画 微热漫画图片 圣痕炼金士 漫画 下载 朱宇辰的所有漫画 桐人和亚斯纳邪恶漫画 水手服漫画图片 乙女 漫画 r18 少女校园爱情漫画大全 七龙珠18号 龟仙人漫画 肉漫库工口少女漫画 日本少女福利肉番漫画 同学自相残杀的漫画 朱宇辰的所有漫画 七龙珠18号 龟仙人漫画 桐人和亚斯纳邪恶漫画 朱宇辰的所有漫画 微热漫画图片 乙女 漫画 r18 绅士漫画h本子福利 蜘蛛侠r18漫画 死囚乐园对应漫画 微热漫画图片 绅士漫画h本子福利 早介作者的漫画 同学自相残杀的漫画 少女校园爱情漫画大全 一方美琴漫画 日本写实派漫画家 手机的漫画图解 这不是dota漫画78 肉漫库工口少女漫画 乙女 漫画 r18 这不是dota漫画78 一方美琴漫画 同学自相残杀的漫画 有什么总裁型的漫画 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 我的三十六岁女房东 重生魔祖之蚊道纵横 致奋斗的青春 大学的江湖 一醉平生 澳门葡京官网 快连下载 欧博官网 澳门葡京官网 欧博官网 这不是dota漫画78 七龙珠18号 龟仙人漫画 手机的漫画图解 七龙珠18号 龟仙人漫画 日本邪恶少女漫画h里 朱宇辰的所有漫画 日本邪恶少女漫画h里 妖精标本漫画 日本写实派漫画家 同学自相残杀的漫画 有什么总裁型的漫画 同学自相残杀的漫画 妖精标本漫画 手机的漫画图解 同学自相残杀的漫画 日本邪恶少女漫画h里 手机的漫画图解 少女校园爱情漫画大全 乙女 漫画 r18 少女校园爱情漫画大全 蜘蛛侠r18漫画 一方美琴漫画 桐人和亚斯纳邪恶漫画 早介作者的漫画 七龙珠全套漫画 肉漫库工口少女漫画 一方美琴漫画 肉漫库工口少女漫画 早介作者的漫画 日本少女福利肉番漫画