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
g 男优漫画boos哥哥你欠揍!漫画gate奇幻世界漫画gif邪恶漫画画动态图片gif邪恶漫画画动态图片大全FUCK!!漫画bl生子漫画人类妖gate奇幻世界漫画bl兄弟np漫画hcf美女福利漫画图片大全gif邪恶漫画画动态图片大全图片大全图片g 男优漫画h福利百合本子全彩漫画贴吧gif邪恶漫画画动态图片大全图片大全gate奇幻世界漫画cf美女福利漫画图片大全bl生子漫画山神gif邪恶漫画画动态图片大全图片gif邪恶漫画画动态图片大全图片free 4p 漫画boos哥哥 你欠揍漫画免费gif邪恶漫画画动态图片大全图片bl兄弟np漫画hc88邪恶漫画少女gif邪恶漫画画动态图片大全boos你轻点漫画gif邪恶漫画画动态图片c84少女漫画fgo玛修全彩漫画h福利百合本子全彩漫画贴吧一群小镇青年在城市的生活,在乡村成长的记忆。他们大都通过读书或其他方式来到城市,成为新城市人,但内心仍保有故乡的影子,家庭的印记,甚至依赖与踌躇。在快速发展当下,有的人紧赶脚步,有的人只能看到别人的背影,这些都将被记录的一页。这个世界文道为尊,文人掌文箓,修文气,开文宫。 九品开窍文箓,一目十行,身轻体健。 八品修身文箓,文字加身,如有神助。 七品仁者文箓…… “诗词歌赋,笔墨丹青,棋艺话本这些你都懂?” “略懂略懂。” “都懂一点也行。” “是亿点点……” 官居一品,权倾朝野? 封王拜相,永享荣华? 不不不,身怀国家图书馆全部资料的李长安,无奈接受了,世人把他名字刻进圣庙的事实。 一个神奇的游戏,一次穿越时空的冒险,一个奇异的游戏时空,不可思议冒险。所有的历史人物齐聚于此,展开一场生与死的厮杀双日凌空,神秘再现,在科技崩溃的废墟中,万物迎来了无限进化! 穿越而来的沈凌,激活了自己的无限世界模拟器。 只要是花费足够的能量,就能够获得在模拟世界中得到的修为、武功和物品! 于是,在小李飞刀的世界中,沈凌获得了小李飞刀! 在大唐双龙的世界中,沈凌修成了剑心通明! 在蜀山的世界中,沈凌拿到了化血神刀! 在洪荒的世界中,他夺取了诛仙四剑……很久很久以前,有一座山,名为葬灵山;葬灵山的西边有条渊,名为无相之渊;无相之渊的西边,有一座学府,名为真武院;而故事,则要从葬灵山东边的那座凌天帝国讲起……我乃李青,今日人族之守护神。若有妖魔残害人族,吾定不饶。落点有误,被迫成了太监的,经历千辛万苦修炼到重生境,得知失去的是大道五十中那循去的一。只有圆满了,才可获得不知道跑到哪里的宝贝! 运筹帷幄算天下,一身修为定乾坤 以凡躯肉体血染苍穹,以无双智计扭转数国时局 震乾坤,逆生死 得至宝,夺造化 破万界,立天道 练就无上神通,击败无数强者,屹立在天道之上,自创天道,沐浴万灵,即是创天主宰。 误入核战后的异世界,遭遇生化魔物。 资源匮乏,科技倒退,身中剧毒,生命被当做了货币,就连武器也变成了原始的冷兵器。 血夜之下的斗者,以“活着”为生存信条,誓要撕碎这夜,刺破这天,凌驾于命运之上! 【雪碧回归之作,再次开启第三人称数据流,重温经典!】 子受穿越为殷商纣王。 系统发布的第一个任务竟然让他找个女人表白,任务失败回到原世界? 子受表示:当nm的暴君,老子要回去! 为了回到原世界,作死表白了女娲。 却没想到阴差阳错地成功了! 子受:女娲是我女朋友怎么办?急,在线等! Ps:此书又名《我的女朋友是女娲》、《女娲好感度爆满了怎么办?急,在线等!》
满朝佞臣,孤要做千古暴君 全球入梦 暗夜赞歌 花满惊鸿,人去空留 军中情报人 百次重生之后成为阴差 诡事专门店 全球高武:天赋放大一万倍 佣兵1929 跨时空的救援 咸鱼的自我救赎 我家储藏室可通大秦 晦暗师途 风序乱清雨 林中宝藏 我的老头儿老太儿 无敌从异世界开始 变局2028 火影忍者穿越到日向家 我脑海中住着一只鬼 boos哥哥你欠揍神漫画 cf美女福利漫画图片 bl生子漫画山神 gif邪恶漫画画动态图片大全图片 boos哥哥你欠揍神漫画 bproject第二季漫画 bl受含道具打架漫画 h本子日本漫画 boos你轻点漫画 h福利百合本子全彩漫画贴吧 bl兄弟np漫画h bl邪恶漫画之sm c88邪恶漫画少女 cf美女福利漫画图片大全 FUCK!!漫画 gif邪恶漫画画动态图片大全 bl受含道具打架漫画 boos你轻点漫画 boos哥哥 你欠揍漫画免费 g 男优漫画 cf美女福利漫画图片 gate奇幻世界漫画 boos哥哥你欠揍!漫画 gif邪恶漫画画动态图片大全图片大全 cf美女福利漫画图片大全 c88邪恶漫画少女 boos你轻点漫画 boos哥哥你欠揍!漫画 boos哥哥 你欠揍漫画免费 boos你轻点漫画 gif邪恶漫画画动态图片大全 cf美女福利漫画图片 gif色漫画19禁 g 男优漫画 c84少女漫画 gif邪恶漫画画动态图片大全 gif色漫画19禁 bl生子漫画山神 c88邪恶漫画少女 gif色漫画19禁 gif邪恶漫画画动态图片大全 h福利百合本子全彩漫画 free 4p 漫画 bl邪恶漫画之sm gif邪恶漫画画动态图片大全图片大全 cf美女福利漫画图片 bl邪恶漫画之sm gif邪恶漫画画动态图片 fgo玛修全彩漫画 bl生子漫画人类妖 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 不要叫我名字 浩瀚大世界 原来我真是世外高人 神王太古 魔界:魔刀决 AG真人 亚星管理平台 亚星游戏官网 AG真人 百家乐官网 c84少女漫画 gif邪恶漫画画动态图片大全图片大全图片 bl受含道具打架漫画 cf美女福利漫画图片大全 gif邪恶漫画画动态图片大全图片大全图片 boos哥哥你欠揍!漫画 cf美女福利漫画图片大全 h福利百合本子全彩漫画贴吧 bl兄弟np漫画贴吧 h福利百合本子全彩漫画贴吧 gif色漫画19禁 bl生子漫画人类妖 gate奇幻世界漫画 c88邪恶漫画少女 gif邪恶漫画画动态图片 bl邪恶漫画之sm gif邪恶漫画画动态图片大全图片大全 bl邪恶漫画之sm c88邪恶漫画少女 bl兄弟np漫画贴吧 bl兄弟np漫画h gate奇幻世界漫画 bl兄弟np漫画贴吧 boos哥哥你欠揍神漫画 g 男优漫画 boos你轻点漫画 boos哥哥 你欠揍漫画免费 c84少女漫画 h福利百合本子全彩漫画贴吧 gif邪恶漫画画动态图片大全图片大全