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
今天不行漫画名侦探柯南漫画01人妻特训漫画绘画漫画可爱萌宠图片大全寄生虫这部漫画空杯前行的寓意漫画日本漫画物语系列人妻特训漫画美少女邪恶百合漫画邪恶少女漫画狐狸纲手本子邪恶漫画今天不行漫画色列漫画里番全彩漫画巴卫和奈奈生漫画亲吻人妻特训漫画邪恶少女漫画狐狸日本漫画中女生的脚巴卫和奈奈生漫画巴卫和奈奈生漫画蓝马尾邪恶漫画拳击手妹子全集漫画巴卫和奈奈生漫画美少女邪恶百合漫画恋欲丘比特漫画下载寄生虫这部漫画让奶牛怀孕漫画绘画漫画可爱萌宠图片大全绘画漫画可爱萌宠图片大全巴卫和奈奈生漫画拳击手妹子全集漫画我的家族史是用血写就的,祖父的神秘,母亲的离奇的死亡,这一幕一幕,让我觉得悲伤而又恐怖。所有的事情都发生在这个古老而又神秘的凶宅,慈祥的父亲不知受了什么刺激,突然变得可怕而又变态,他做着让人毛骨悚然的实验。一个又一个未解的迷题,让我不知所措,其中隐藏着一个扑朔迷离的故事,且听我中娓娓道来。【奇迹】第一高手,因战队成绩不佳,惨遭俱乐部逼宫扫地出门。 被扫地出门的他,来到一家游戏工作室担任打金人。 【奇迹】第一高手岂是普通的打金人?上到各大公会,下到小鱼小虾被他收拾的服服帖帖。 有人问,【奇迹】第一高手就这么沦为打金人,他真的心甘情愿吗? 他的回答是,这一次我要为自己战斗,也要在这里强势回归。 15岁的少女欧阳墨含在高中前最后一个暑假得知了有关她的父亲和母亲的消息,原来他们在墨含六岁的时候被一个组织杀害了。墨含决定潜入组织为父母报仇。进入高中,她遇到了同样潜入组织的上官华杉,两人有着一定的关系。与此同时,他们还遇到另外三个少年,大家都因为不同的原因独自对抗组织。于是,一个秘密小组成立了......冷风如刀,以大地为砧板视众生为鱼肉;飞雪似剑,以苍穹为帷幔斩现实为红尘。 天下纷扰由剑起,世间忧愁识字出。 吾愿以己为祭品,换得世间永太平。 【新书发布,只为创造经典】蓝星人族降临无尽大陆,成为县令,这里万族争霸。 降临之初,每位县令都会随机获得一座县城和兵营。 招募兵种,掠夺资源,建立王朝,争霸万族! 而白源发现,自己竟然可以给兵营、建筑、文臣武将甚至是自己刷词条! 金色词条【真龙天子】【治世贤臣】【乱世虎将】【天官赐福】 紫色词条【破军煞气】【金戈铁马】【平定一方】 白源将自己的麾下全部刷出神级词条,带领着自己的文臣武将,从一介小小县令开始,踏上万族争霸的无尽征程,慢慢的,他站在了世界的最高处,从零开始打造了无上神朝! 武道崛起,江湖与朝堂的纷争喋喋不休…… 乱世之中,且看他如何一人一拳横行其中!【千术】+【悬疑】+【腹黑】 我出生千门,千门分八将,上八将和下八将,上八将才是千门正统,手法高明,多方配合,讲究‘术法’,下八将最为让人不齿,没有高明手段,只能坑蒙拐骗,坏事做尽。 我的叔叔是正统的千门正将,我和他学了很多手段,但十赌九亡,在我而立之年,因为千术而进去了,整日唱铁窗泪,现在我弃暗投明,想给大家讲讲我曾经的故事,起到一些警示作用……宋清书穿越综武世界,成为武当三代首徒宋青书,本应该是一个神仙开局。 然而宋青书已经杀了师叔莫声谷,还背叛丐帮,正在被陈友谅追杀,随时可能丧命。 就在这时,绝世舔狗系统激活。 绝世武库向他敞开,只要赚取积分,就能疯狂买买买。 九阳神功,买! 凌波微步,买! 战神图录,买! 咦,竟然还有八九玄功和草灭剑诀,难道……第一风辰集团董事长的女儿离家出走,意外碰上身份不明的热血少年,在弱肉强食的年代究竟会擦出怎样的火花呢?李相,一名24岁大学生 意外穿越到武侠修真世界 从武侠小白变成行走江湖四处留名的一代大侠 一路上鲜衣怒马,一路上血溅四方 经历过众叛亲离,历经过人间温暖 敢问在下何人 “李相是也”
关于冒险六章的那些事 逆仙成魔传 茅山道徒 规则碎片 溯源仙迹 光与暗的黑龙翼 成仙之前 我穿越了自己的小说 遍地生花 无尽仰望 虚度三十年华 我竟成了女主的召唤骷髅兵 一个农村娃娃的梦想 至高血神 第三研究所 荒野暮年 妖顺记 玄天灵阁 耐普罗德之书 诸神将临:我有斩神模拟器 人妻电车痴汉 在线漫画 邪恶少女漫画致怀孕篇 rider士郎漫画 巴卫和奈奈生漫画亲吻 人妻电车痴汉 在线漫画 恋欲丘比特漫画下载 美少女邪恶百合漫画 色列漫画里番全彩漫画 六月七月漫画图片 日本漫画物语系列 拳击手妹子全集漫画 豪华监狱 漫画 邪恶少女漫画致怀孕篇 让奶牛怀孕漫画 当姐姐睡着后漫画 美少女邪恶百合漫画 今天不行漫画 纲手本子邪恶漫画 寄生虫这部漫画 日本漫画物语系列 邪恶漫画美女警察被 日本漫画中女生的脚 巴卫和奈奈生漫画 拳击手妹子全集漫画 让奶牛怀孕漫画 邪恶少女漫画致怀孕篇 纲手本子邪恶漫画 巴卫和奈奈生漫画 寄生虫这部漫画 纲手本子邪恶漫画 美少女邪恶百合漫画 邪恶漫画美女警察被 rider士郎漫画 邪恶漫画美女警察被 rider士郎漫画 恋欲丘比特漫画下载 人妻电车痴汉 在线漫画 好想你的照片漫画版 美少女邪恶百合漫画 人妻电车痴汉 在线漫画 恋欲丘比特漫画下载 绘画漫画可爱萌宠图片大全 蓝马尾邪恶漫画 rider士郎漫画 巴卫和奈奈生漫画亲吻 好想你的照片漫画版 美少女邪恶百合漫画 绘画漫画可爱萌宠图片大全 礼物漫画全集观看 日本漫画物语系列 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 独狼道 神魔在人间 十一殿 仙家聊天群 炁芯 万利官网 欧博官网 皇冠登3出租 万利官网 澳门葡京游戏官网 蓝马尾邪恶漫画 礼物漫画全集观看 豪华监狱 漫画 好想你的照片漫画版 拳击手妹子全集漫画 蓝马尾邪恶漫画 今天不行漫画 蓝马尾邪恶漫画 单人双打邪恶少女漫画 空杯前行的寓意漫画 黄金的鸟笼漫画历史 邪恶少女漫画致怀孕篇 六月七月漫画图片 邪恶漫画美女警察被 巴卫和奈奈生漫画 日本漫画物语系列 恶毒的护士漫画 日本漫画中女生的脚 纲手本子邪恶漫画 恋欲丘比特漫画下载 今天不行漫画 恶毒的护士漫画 邪恶少女漫画致怀孕篇 好想你的照片漫画版 邪恶漫画美女警察被 邪恶少女漫画狐狸 当姐姐睡着后漫画 拳击手妹子全集漫画 当姐姐睡着后漫画 黄金的鸟笼漫画历史