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
交行信用卡攻略交行信用卡免费还款期交行信用卡好享贷利率交行信用卡华夏信用卡哪个好交行信用卡华夏信用卡申请进度查询中心交行信用卡攻略交行信用卡积分怎么兑换商品交行信用卡好享贷利率交行信用卡金卡转账手续费多少交行信用卡积分兑什么交行信用卡积分10000交行信用卡好享贷利率交行信用卡积分兑什么时候交行信用卡积分10000交行信用卡华夏信用卡交行信用卡积分兑什么交行信用卡交学费交行信用卡火车票7折交行信用卡华夏信用卡申请进度查询中心交行信用卡刷哪行业好交行信用卡金卡转账手续费多少钱交行信用卡火车票7折交行信用卡金卡转账手续费多少交行信用卡手机软件交行信用卡华夏信用卡申请进度查询交行信用卡年限交行信用卡华夏信用卡申请进度查询交行信用卡欠款4000多交行信用卡刷哪行业好交行信用卡积分清零这是一本来自末日的旅行手札。 撕裂的天空、不详的辐射云、阳光已经彻底消失。这便是毁灭日之后的大地。 但在这末世之中,却有一对仿佛父女般的青年男子和小女孩匆匆赶路。 他们从何处来?又去向何方?他们苦苦寻觅的究竟是何物? 这一切无人可知。唯一能够确认的,只有他们穿行于弥漫于世的灾难,继续无尽的的旅程…… ※黑暗风末日小说,每两天更新一次,欢迎收藏※ 震惊!   九旬老邪祟被当街殴打,并被捏断脖子;河畔女尸被人揪住头发,按在水里差点淹死;冤死灵童被强制劳动每天二十三小时五十九分钟,最终不堪重负,主动报案称有人虐待童工……   吴甚:大家别听外面的人瞎说,其实世界上根本没有邪祟。   众人:我信你个鬼哦,你手里抓的是什么?   吴甚看了看手里已经在翻白眼的吊死鬼,连忙发力,“蓬”的一下将其捏死,看着化为黑雾消散的吊死鬼,笑道:“诺,你们看,什么都没有,一切都是幻觉。”这是一部以电影剧本为主要创作构思基础的作品,故参考了电影剧本的格式进行写作,每一个段落就是一个电影场景画面和镜头展示,暂且称这部作品为非专业的“纸电影”吧。 故事讲述一位忠国少年文润华在米国夏为宜读中学时意外发现了一颗纯度达90%的金子流星,这颗流星会在十年后到达地球。之后,在对太平洋海底地质的科考研究中,文润华发现了太平洋地壳板块的不稳定性与存在裂纹的隐患。不久后,月球满月之际,在月球引力、金子流星磁场、太阳风暴的共同联动影响作用下,地球内部的地幔的能量平衡被打破,太平洋东南部海底的板块突然崩裂,产生大地震,同时掀起了巨浪,环太平洋很多地方的火山爆发,在水与火的双重袭击下,很多地区受灾严重,全球各国参与救灾,而忠国扮演了最重要的角色…… 林啸意外穿越特种兵的世界,随身带着最强国术系统。 每提升一个等级,不但身体会得到强化,还能获得新的国术,成为自己的天赋神通,既分高低,也定生死。 暗器精通:拥有此技能,你可以熟知每一件事物的属性,能将任何一种物品当作杀人的利器,杀人是一种技术,不滞于物,请谨慎使用此技能。 何晨光:“你从娘胎就可以练功吗?” 雷战:“牙签也能杀人,老子服了!” 安然:“啸哥,你确定你的女友是大明星?不是特种兵?” 范天雷:“狼牙的未来就交给你了,老子提前退休。苏阳在国外的少年武道大赛之上取得惊人的成绩,连续五年夺冠人称五冠王,年少的他是一个难得武道天才。随着他转学进入华夏的天星高中,由于这个个性十分孤傲的他,引起了诸多的误解,因此陆陆续续有不少的人对他发起了挑战...... 系统傍身,杀一人,活一天; “以死神的名义,你必须死!” “以死神的名义,毁灭他们!” 死神:“呃...你不要坏我名声!”妖魔并起,人族大秦风雨飘摇。 林枫穿越成为大秦书生,觉醒神级读书系统,只要读书就可以提取神通,获得才气值抽奖。 “叮,宿主翻阅《天龙八部》,提取神通下笔如有神!” “叮,宿主进行紫级奖池抽奖,抽到圣级修为!” …… 大秦生死存亡之际,一位青衫书生横空出世,吟唱成剑,风采绝世,无数神通尽出,百万妖魔飞灰湮灭!鹰隼大队飞行员马赫,经过了挫折成长成为了一名合格的指挥员,由于陈宁的晋升。马赫带着自己组建的分队回到鹰隼大队并且担任了鹰隼特种旅的旅长,并且鹰隼大队更换了歼十,成为了外军模拟部队 这是一个近似未来地球的异世界。 名为“黑石”的神秘矿物能将人的情绪与欲望收割转化,为这个世界提供了近乎无穷无尽的能源。 普通人就是被无尽收割的活能源,如同“工具”和“零件”生存。 财团,高官,各种特权者们争权夺利。 而他将颠覆这个世界的规则。小丫头的声音却响了起来:“大哥哥,这个座位你不能坐”。 我瞬间疑惑了,便问道:“小妹妹,为啥哥哥不能坐啊?” 小丫头一本正经的说道:“因为这个座位是给快死的人坐的。” 我顿时毛骨悚然道:“小妹妹,别开玩笑了,大白天的怪吓人的!” 小丫头脸色一下严肃起来道:“大哥哥,你今天不对劲哦!晚上的时候小心一点,有不干净的东西一直盯着你!白天不会怎么样,但是晚上可就危险了!” 我四周看了看,顿时打个冷颤道:“小妹妹你能看到不干净的东西?” 小丫头好奇道:“大哥哥,你也能看到啊!” 我还不太理解小妹妹的话,就在这时一个阿姨拍了拍我的肩膀道:“小伙子!你在跟谁说话啊?” 我下意识的转头说道:“跟一个小丫头聊天啊!” 可是当我再次转过头来哪里有什么小丫头? 阿姨疑惑的说道:“我看你对着椅子说了半天的话,你到底坐不坐?不坐让阿姨坐,阿姨站累了!” 我顿时全身冒汗,四肢发软一句话也说不出来。
浊云录 这就是火之意志 漫天风飘絮下:南朝北国 红楼:开局便娶秦可卿 大明:我能翻阅华夏图书馆 血染的风采燕然勒功 幻界:神魔录 平平的人生 突围:阿贼克深一生之敌 探索小队 我将守护你的未来 全球灾变:我有百倍振幅 玄令 奇怪侦探所 重生回到刚实习时 七步神灵 乔乔的奇妙冒险:十字之魂 临星瀚 修仙犯法么 大道源 交行信用卡开卡收费吗 交行信用卡积分10000 交行信用卡积分怎么兑换商品 交行信用卡华夏信用卡哪个好 交行信用卡开卡收费吗 交行信用卡能加油吗 交行信用卡积分怎么兑换商品 交行信用卡积分到账时间 交行信用卡免费还款期 交行信用卡积分兑什么 交行信用卡交学费 交行信用卡交学费 交行信用卡欠款4000多 交行信用卡积分10000 交行信用卡刷哪行业好 交行信用卡华夏信用卡哪个好 交行信用卡激活过期 交行信用卡免费还款期 交行信用卡金卡转账手续费多少 交行信用卡发卡要多久 交行信用卡积分10000 交行信用卡发卡要多久 交行信用卡金卡转账手续费多少 交行信用卡华夏信用卡申请进度查询 交行信用卡积分到账 交行信用卡欠款4000多 交行信用卡开卡收费吗 交行信用卡金卡转账手续费多少钱 交行信用卡金卡转账手续费多少 交行信用卡年限 交行信用卡华夏信用卡申请进度查询中心 交行信用卡积分到账 交行信用卡华夏信用卡哪个好 交行信用卡攻略 交行信用卡手机软件 交行信用卡华夏信用卡申请进度查询 交行信用卡华夏信用卡哪个好 交行信用卡交学费 交行信用卡手机软件 交行信用卡华夏信用卡 交行信用卡华夏信用卡申请进度查询 交行信用卡积分兑什么好处 交行信用卡刷哪行业好 交行信用卡金卡转账 交行信用卡积分10000 交行信用卡积分到账 交行信用卡金卡转账手续费 交行信用卡华夏信用卡申请进度查询 交行信用卡刷境外机 交行信用卡激活过期 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 雪史功业 少女心事日记 拂尘不见人 我的新时代家庭农场 诸神博物馆 亚星管理平台 葡京官网 AG真人 亚星管理平台 万利官网 交行信用卡华夏信用卡申请进度查询中心 交行信用卡开卡收费吗 交行信用卡开卡收费吗 交行信用卡积分10000 交行信用卡积分到账 交行信用卡华夏信用卡申请进度查询 交行信用卡积分清零 交行信用卡积分到账时间 交行信用卡金卡转账手续费多少 交行信用卡年限 交行信用卡华夏信用卡申请进度查询中心 交行信用卡积分兑什么好处 交行信用卡能加油吗 交行信用卡积分10000 交行信用卡刷哪行业好 交行信用卡华夏信用卡申请进度查询中心 交行信用卡华夏信用卡申请进度查询 交行信用卡金卡转账手续费多少钱 交行信用卡金卡转账手续费多少钱 交行信用卡积分10000 交行信用卡积分10000 交行信用卡华夏信用卡哪个好 交行信用卡华夏信用卡申请进度查询 交行信用卡积分到账 交行信用卡积分兑什么好处 交行信用卡交学费 交行信用卡刷境外机 交行信用卡华夏信用卡 交行信用卡免费还款期 交行信用卡刷哪行业好