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
我们都是坏孩子 电影下载我和我的代理司机电影我们只是兄弟法国电影托尼贾电影男人崛起外国农场爱情电影我们都是坏孩子 电影下载推荐好看的俄罗斯电影下载我们只是兄弟法国电影同线车电影在线观看完美的感觉电影外国著名的电影灯光师我们只是兄弟法国电影推荐电影的活动外国著名的电影灯光师我是传奇2 电影下载完美的感觉电影偷命 电影下载外国喜剧动作电影大全外国农场爱情电影我们的社区电影没看懂同线车高清电影外国喜剧动作电影大全同线车电影在线观看我们的社区电影结局瓦哈卡的破灭 电影我老婆又大肚子电影瓦哈卡的破灭 电影我们的社区 韩国电影我们的社区电影没看懂推荐好看的俄罗斯电影大盛帝国边境一时间狼烟四起,烽火连天。镇远府陷落,敌军的铁骑逼近上京。内阁首辅之子郭曦受封征北将军,率军支援上京防线,面对危急的局势献出妙计,亲率军队大败北乾。 但随着他的凯旋而归,一场场政治风暴也随之而来。 自此之后,一代军事天骄崛起,他八出奇计,淹司城,烧井阳,千里奔袭包抄敌军……他用一次次的碾压的胜利剿灭五国,告诉侵略者:胆犯大盛者,虽远必诛。 最终,他踩着尸山血海与成林枯骨,用着阴谋诡计一步步走向了皇位,成就了一代传奇战神。(非穿越,非重生) 天纪界300年,人族发展数万年,与魔人对抗千年,终于迎来和平。 天纪界340年,魔人卷土重来。 天纪界341年,全民模拟,选出模拟者对抗魔人。 最后一次临时模拟人生时,觉醒特殊技能:天启! 天启:可以经历分析一切。 获得模拟人生经验越多,天启分析速度越快。 靠着特殊技能,张元一次又一次突破极限,融合模拟人生。 天纪界某某年,魔人被永久封印! 一世:【身患重病,没有战胜病魔,死亡。】 “天启开启,分析!” 【你战胜病魔,成就玄武传说。】 【天启增强,你获得灵源空间,你获得模拟人生优先选择,你获得..】 某世:【二十岁的你,被困魔人捆仙阵而死。】 “天启开启,分析破阵!” 【你分析每一世模拟人生,各方大能见到你的模拟人生,纷纷掉泪。】 【你获得女帝青睐,你获得最强天启,你获得...】 同届临时模拟者,都成为了普通人,苟延残喘。 与此同时,各个平行世界入侵主世界。 张元站了出来,“你们这些被我征服的世界,也敢嚣张?”还没看完一页,叶牧就忍不住合上了少年时期的日记本。 “我这写的是什么中二日记啊?” “太羞耻了!” “会社死的吧?” 【叮!神级日记系统激活!】 【自动为宿主的日记购买全球热门推荐!】 【全球点赞过千万,解锁全新功能!】 【恭喜宿主百分百还原事件,奖励混元大罗圣斧!】 受到混元大罗圣斧影响,两个世界不再平行,出现大量未知干涉现象。 殷墟石壁惊现日记,轰动全球! …… 叶牧震惊了。 他写的中二日记竟成真的了!实习生林天意外获得祖先的传承,看林天如何在都市逍遥...「你这外乡人既然觉得关内的人心太复杂,当初你又为什么会从关外进来呢?」 面对这个问题,谢佳晨只是回答:"我只想找到回家的路,没想到事情会发展成这样子。" 「我看你是找死!」 夜良游漫不经心地回应,连夜府独门身法「瞬息闪」都看不明白的人,恐怕被别人杀了都不知道对方是谁,这样的人在烈州还能修炼到化龙境巅峰,真是奇迹了。 「人世间的事情是很难预料的,再加上每个人不同的强烈欲望,从而形成这江湖上的格局。」 「朝堂,分为两派,一派主战一派主降,在统治者的视角看来,主战的怂恿之人该杀,主降的苟且偷生之人该死。」 「宗门,是培养人才的地方,处于最弱方,仅靠着门下那几颗璀璨的新星得以正常存在下去。」 「天行健,君子以厚德载物。」 「集打工人、房奴、社畜于一体的小谢因为一场车祸,导致灵魂被撞飞到了异界龙魂大陆,在这个集宗门、江湖、庙堂于一体的世界中,倒霉的他该如何生存?被黑白两道追赶地走投无路,黑化后的他又是如何的恐怖?」大婚之日,老丈人竟是杀父仇人。 本是一桩隆重的婚礼却变成了一场精心谋划的杀局。 族人的背叛,兄长惨死。 命运之手紧扼少年喉咙。 逆阴阳,改因果,少年独坐虚空,遥看四方劫云“这三界,我罩着” 在这元宇宙高度发展的时代,某一天,数十亿人降临万族大陆,成为城主,参与万族争霸。 降临之初,每个城主都会随机获得初始兵种。 招募兵种,掠夺资源,争霸万族。 岛国:”哈哈哈,我的兵种乃是奥特曼,专打怪兽,华夏国的蝼蚁们,颤抖吧!“ 米国:”永恒族.......看我打造无限手套,一个响指灭你华夏。“ 阿三:”整个万族大陆都是我神族创造的.......“ 看着如此嚣张的几国,林天看了看脚下的九爪金龙,不禁陷入沉思,这几国脑子瓦特了? 星游在逃脱时空乱流后随机降落到了一个星球上,物资将尽的他喜出望外地勘测了一番,却发现这个星球上的生物正是追杀从而致使他落入时空乱流的相族的祖先…… “元姬,别拦我,让我炸了这个星球!” “可是……主人……我们已经没有能够摧毁星球的武器了啊……您忘了它们早就丢失在时空乱流里面了吗?” “那就再给我造出来……” …… 种田文(雾)是一个充满在神秘色彩中的反正义跨国杀手组织,故事由一起轰动全国的庞大组织杀人案的曝光引发,反正义和正义与之抗衡。 他不是想一个人孤单,只是想为了她孤单,她说今生无缘,那他就逆命改天…… 一个普通弟子。一路逆袭的故事。
重生被女帝提亲 逆吞强噬 黑色诱惑之天罗地网 洪荒英雄传 英雄传说 北冥真经 传奇人生:梅林 畸变末世 玄幻宠物小精灵 卷帘大将前传 零神 都市修真日记 留守儿童之阿礼 我有一把剑,可斩世间敌 春野小仙医 鬼王降临 使命之匡扶正义 重生之魔尊不好当 山海霸主 西游胡闹记 玄幻:开局镇压长公主母女 我看亲吻的电影 外星动漫电影 偷命 电影下载 外国农场爱情电影 我和我的代理司机电影 我们的社区 韩国电影 偷命 电影下载 完整电影 巴赞 我老婆又大肚子电影 推荐电影的活动 同线车电影在线 同线车电影在线 我们的社区电影解析 外星动漫电影 我们都是坏孩子 电影下载 外国农场爱情电影 偷命电影下载 我看亲吻的电影 同线车国语电影 我们只是兄弟法国电影 外星动漫电影 我们只是兄弟法国电影 同线车国语电影 外国喜剧动作电影大全 完美的感觉电影 我们的社区电影解析 我看亲吻的电影 我和我的代理司机电影 同线车国语电影 我老婆又大肚子电影 外国农场爱情电影 外国最好看的科幻电影 托尼贾电影男人崛起 我们都是坏孩子 电影下载 我们的社区电影结局 瓦哈卡的破灭 电影 托尼贾电影男人崛起 偷命 电影下载 我们的社区电影结局 我是传奇2 电影下载 瓦哈卡的破灭 电影 完整电影 巴赞 我们的社区电影没看懂 偷命电影下载 外国著名的电影灯光师 外国最好看的科幻电影 同线车电影在线 瓦哈卡的破灭 电影 我们的社区电影解析 偷命 电影 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 返虚 宇宙星河之地平线下 暗处的人 居然有个高手:鬼江湖 我在异界修仙问道 亚星官网 欧博游戏官网 欧博官网 亚星官网 欧博官网 完美的感觉电影 我们的社区电影啥意思 托尼贾电影男人崛起 同线车电影在线观看 推荐好看的俄罗斯电影 完整电影 巴赞 我老婆又大肚子电影 推荐电影的活动 偷命 电影 我看亲吻的电影 偷命 电影下载 外国农场爱情电影 同线车电影在线 我们的社区电影解析 我们的社区电影啥意思 我们的社区电影没看懂 同线车高清电影 外星动漫电影 同线车国语电影 我们的社区电影啥意思 我看亲吻的电影 同线车国语电影 瓦哈卡的破灭 电影 我和我的代理司机电影 我们的社区 韩国电影 托尼贾电影男人崛起 我们的社区电影结局 偷命 电影 我们的社区电影没看懂 偷命 电影