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
电话订票 北京 区号威海到太原大巴时刻表查询电话常熟到明光汽车电话濮阳贵和园酒店电话号码查询中联广场好乐星电话电话订票 北京 区号济宁佳宝乳液电话常熟到明光汽车电话中华美德公园电话安徽省博物馆老馆电话红旗建材批发市场电话电话订票 北京 区号大连嘉兴物业电话多少钱一个月红旗建材批发市场电话常熟到明光汽车电话菏泽银座商城投诉电话沈阳北到大庆的高铁时刻表查询电话中联广场好乐星电话中联广场好乐星电话福清火车票代售点电话广西容县总站电话北京昌平采摘草莓电话中华美德公园电话淮北大个花甲电话多少钱happy卡客服电话青白江出入境电话号码濮阳贵和园酒店电话号码查询承德美的售后电话福清火车票代售点电话汉中博物馆电话深渊之中机遇与危机并存,生死与命运相连,于这神秘中,在这深渊中,何者生存虚镜、灵镜,主人公虚灵从太虚大陆开始生活、修练、强大,经历过欺骗、伤害,一切一切的过往、经历让主人公虚灵战胜一切、克服一切,直到战在虚镜、灵镜之巅,才发现原来的一切也只是一场梦。穿越洪武年间,身为凤阳县令的岳麟,竟被权相胡惟庸弹劾贪污! 皇帝大怒,微服私访,被当做“暴发户”的老朱,自然得到了岳麟的亲切接待。 “这是后膛枪,买了它,北元鞑虏灰飞烟灭,任谁都要给你几分薄面!” “这是工艺坊,十岁小孩弹溜溜,百岁老人盘核桃,出口一本万利!” “这是福利院,老有所依,幼有所养,以后儿孙不孝,免费入住!” 岳麟只觉得,暴发户老朱身后的几个青年,看他的眼神之中充满杀气。 “奉天承运,皇帝诏,曰:岳麟奉旨贪污,为我大明富国强兵!” 本该在那个人身下殒命的陆空意外借助神器穿越回了几个月前完成重生。受尽屈辱,队友纷纷在自己面前倒下的屈辱让他咬牙切齿,这次,自以为拿着剧本的他就要把羞辱自己的人踩在脚下羞辱一番。可关键时刻竟然想不起那个人是谁了?不对,是完全忘了这几个月发生的所有事情。 “妈的小说也不是这么写的,老子重生了不应该手握剧本手刃仇人然后有头有脸的,现在让我什么鸡毛蒜皮的事情都想不起来,你是想第一章就太监是吗,好歹让我记住一个隔天中奖的彩票号码啊。”陆空对屏幕外扣字的那个死宅骂骂咧咧。 死宅却故作高深地说:“我只想做第一个吃螃蟹的人讲一个不同寻常的异能故事。” (新人作品,希望各位多多指教)穆曦辰生在一个世家大族,但在一个夜晚,他所在的家族和族人被某个势力所灭,他和妹妹侥幸逃跑,在深山之中被一位神秘强者收为门徒······ 他们能否找到灭族真凶,为族人报仇呢?本书又名:《炒股致富真是太难了》、《韭菜的自我修养》、《如何不被股市绿》、《技术流&amp;amp;价值投资流的选择》、《亏损八成的我是如何回本的》、《斩断亏损让利润奔跑》、《拒绝成为股市中的乌合之众》、《炒股就是赌运气,别用实力亏掉靠运气赚的钱》······ 看铁逵炒股直播的网友们表示,以上书名都是错的,本书应该又名:《可恶,又被他买到涨停股了》、《放开那个涨停板,让我上!》、《高喊要亏光的他又赚到了》、《他真把股市当取款机》、《我要拜他为师学炒股》、《买股票一定要跟紧他的步伐》······我打开了那扇门, 后面有人正在追我, 我锁上了那扇门。 我开始观察门里面的世界: 头顶有一盏吊灯发出微弱的光,这样的吊灯总共有5个,从门口到对面,每隔3米有一个吊灯。这里像是一条走廊,走廊的尽头好像有一本书放在什么东西上。 我听到有人跑了过来,而且,他已经开始敲门了。 我感觉我就要死在这里了。 右手边突然亮起了灯光,很刺眼。 那里又是一道门,门上像是写了什么字,模模糊糊的,看不清。 我下意识地打开了那扇门。 …… …… …… “欢迎来到迷途游戏。” 【q1379381940】天道之下的人,在追求着天道。只是,天道又是什么?人在追求什么?  常定宇穿越民国,成为当地乡绅子弟,激活《世界首富》系统,并青春永驻,容颜一直停留在了二十出头。 但他无心壮大个人财富,反而创办大学,抗击奴人,屡立奇功,身上伤疤无数。   最终因为系统原因,常定宇战争尚未结束就直接进入了活死人的状态,直到百岁生日这一天才苏醒过来。   一日,常定宇骑着电动车和大妈相撞,被大妈诬陷碰瓷。   围观的路人纷纷对他指指点点。   “年纪轻轻的干什么不好,竟然也学老人碰瓷,一个大小伙子,你害臊不害臊?”   常定宇非常气愤,他从来没被人这么冤枉过,想上前理论,结果被大妈扯坏了衣服。 一身伤疤触目惊人,众人都傻了…… 少女珂玥秘密守护着“时间之刃”——能将时空伸缩、折叠及扭曲的远古神器。魔界使者姽媚奉命转世追杀夺宝。暗物质世界(异次元时空)的蜥族人创立空玄教,寻找上古神族基因,欲统天下……神秘的“觉醒者”,似乎无处不在,却让人看不见摸不着。珂玥几近绝望之际,才发现“觉醒者”竟然是……?
超能异术:传奇忽悠苏大师 我在圣大陆当战地记者 红尘借道 小农村的离奇故事 世界晋升:修罗枪神 我在异界搞革命 古灵帝君 圣域九歌 我靠出其不意横推里世界 晚上不睡觉 全职猎人之魔王 哲学家与冒险家 无敌从进入梦境开始 第一念元素 铠甲勇士:我只想活下去! 异界元素 争霸 尘间留不住 御祈师 冰雪七零七 鬼佛剑帝 青白江出入境电话号码 菏泽银座商城投诉电话 深圳德仕堡电话 中联广场好乐星电话 威海到太原大巴时刻表查询电话 承德美的售后电话 深圳德仕堡电话 麋鹿苑电话 北戴河交通电话是多少 大连嘉兴物业电话多少钱一个月 丁山邮政电话 丁山邮政电话 淮北大个花甲电话多少钱 菏泽银座商城投诉电话 电话订票 北京 区号 happy卡客服电话 揭阳河婆律师电话 青白江出入境电话号码 盘锦到拜泉客车电话 常熟到明光汽车电话 菏泽银座商城投诉电话 常熟到明光汽车电话 盘锦到拜泉客车电话 北京昌平采摘草莓电话 安徽省博物馆老馆电话 广德汽车客运站电话 青白江出入境电话号码 盘锦到拜泉客车电话 盘锦到拜泉客车电话 北戴河交通电话是多少 中联广场好乐星电话 长春浣溪沙电话 濮阳贵和园酒店电话号码查询 电话订票 北京 区号 淮北大个花甲电话多少钱 happy卡客服电话 濮阳贵和园酒店电话号码查询 深圳德仕堡电话 淮北大个花甲电话多少钱 在国外怎么打银联电话 happy卡客服电话 麋鹿苑电话 福清火车票代售点电话 揭阳河婆律师电话 红旗建材批发市场电话 长春浣溪沙电话 丁山邮政电话 happy卡客服电话 广德汽车客运站电话 沈阳北到大庆的高铁时刻表查询电话 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 九魔圣墟 怎样在攻略游戏里摆烂 俗世录 末世诸天进化 方宗 万利官网 皇冠登3出租 百家乐官网 万利官网 欧博官网 沈阳北到大庆的高铁时刻表查询电话 丁山邮政电话 淮北大个花甲电话多少钱 中华美德公园电话 深圳德仕堡电话 盘锦到拜泉客车电话 长春浣溪沙电话 安徽省博物馆老馆电话 菏泽银座商城投诉电话 青白江出入境电话号码 广西容县总站电话 北戴河交通电话是多少 在国外怎么打银联电话 happy卡客服电话 北戴河交通电话是多少 深圳德仕堡电话 濮阳贵和园酒店电话号码查询 红旗建材批发市场电话 北京昌平采摘草莓电话 黄村中医院电话 淮北大个花甲电话多少钱 菏泽银座商城投诉电话 丁山邮政电话 盘锦到拜泉客车电话 中华美德公园电话 大连嘉兴物业电话多少钱一个月 电话订票 北京 区号 happy卡客服电话 汉中博物馆电话 济宁佳宝乳液电话