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
140的作文【空中观景】小学作文“奖品”话题作文…的三人世界作文…来了作文题目07年江苏高考作文题目07年高考作文题目分析“奖品”话题作文08年广东高考作文题目.读书的满分作文“走进小说天地作文"指导140的作文04年作文题【想起你我就 】优秀作文“奖品”话题作文.读书的满分作文《危急时刻》400字作文08届高考作文08届高考作文……也是一种享受初中作文【干货】2015.12四级作文预测5篇08届高考作文08年广东高考作文题目“虎妞”也有善良的一面作文500…来了作文题目《我家乡的环境》作文350字…的三人世界作文《雾》200 字作文【探索】作文04年作文题*****《流浪在仙界》的有声图书已经在喜马拉雅上架了,多谢各位多去关注。*****百里长青穿越到仙界后发现:地球的心法远不如仙界的功法,但地球的武技却远高于仙界的武技。 汉武帝以:“侠者,以武犯禁”为借口,将江湖上的大部分武林高手围剿斩杀。百里长青(原名郭解)和他的八个兄弟,四个婢女,七个徒弟,还有五千个生死兄弟,在卫青大将军的十万大军合围后,全部万箭射杀,最后被仙界大佬救下灵魂穿越到仙界的凡人界,要求他们去仙界完成一个非常重要的任务。 百里长青带着他的兄弟和徒弟在仙界杀进凡人界,仙人界,神界等一个又一个的大陆,破解一个又一个的惊天阴谋,最终尘埃落定! 三世为人,穿越到仙界后百里长青一切看淡,性格大变,游戏风尘,风趣幽默尽在本书中。 一个残疾人靠着幽默在现实直播中实现自身价值。 一个粉丝心中的无冕之王。 老婆多,是他的第一个标签。灵魂歌手,尿床是他的家常便饭。路维上一秒还在小门派的最底层摸爬滚打,下一秒就成为了魔皇…… 有谁能告诉他这是什么情况? &amp;quot;魔皇大人!请带领我们重振魔族吧!&amp;quot; &amp;quot;呵呵&amp;quot;路维内心冷笑&amp;quot;这梦也太他妈真实了。&amp;quot; 且看疑似魔皇的少年如何走向巅峰。 废柴人生,怎样脱胎换骨,意外开启阴眼怎样面对未知世界,请各位客官紧好孩子,拴好狗,备好啤酒瓶子易拉罐,瓜子花生羊肉串,耐心听老王我一一道来她在我的世界里死了无数次。我一次一次见证她的死亡。每一次都见到新的她,如同凤凰涅槃,浴火重生。 时间就像黑洞一样侵蚀着这个世界。我越是选择帮助她,自己的命运与她的命运互相交织,缠绕。 我和她一起揭开他死亡的原因。途中充满了未知的风险和威胁。 非自然死亡渐渐有了原因。最终在无数个实验推敲后的世界,有了一个彼此深信的答案。 我穿梭在数不尽的时空,灵魂被撕裂后,又被重组,宇宙的秘密没有尽头,阳光照不到的地方,潜藏了未曾了解过的世界。 又是谁在推动着我一步一步走向未知,踏入一片寂静,苍白之地…… 原来,是她杀了自己…… 女主:夏季 男主:邱文博天生至尊,为人族斩妖除魔!护人族万垂不朽!江宇泽前世遭兄弟的反水,亲朋的质疑,爱人的背叛,不幸陨落。烟消道散之时,竟发现在这大千世界之中,源灵大陆只不过是一粒尘埃。万年后得以重生,挖掘新的力量,开创新的规则,以源灵大陆为基础,向未知探索! 自上古时期,人们敬畏神灵。在千百年间,人们发现了能够吸收灵气修炼自己的方法。人们对神灵的神力逐渐轻视,甚至挑衅神灵。奈何江湖高手众多,神灵乃万物之灵,数量稀少。为了人神共存,两界巨头决定联姻计划。神界选择了龙女白小林,而人界为了驸马之位,分为两派。战争也从此打响。天地不仁,以万物为刍狗;帝王封建,以百姓为刍狗…… 在人类历史伟大的祭坛之上,满是殉难者了无生气的空壳;生命之火早已弃之而去,短暂的辉煌之后便是永久的沉寂…… 这,就是刍狗的宿命,千百年来从未改变…… 如果有一股不知名的力量萃聚进而复活所有星星点点的余烬,那么这份光芒可否感染幽暗无垠的苍穹…… 于是,这一刻终于到来了……【天才,穿越,扮猪吃虎】在一个需要武魂才能修炼的世界,穿越而来的周庆却获得签到修仙系统,走上一条和这个世界所有人都不同的一条路:修仙。 恭喜获得体质:无瑕仙体,仙帝功法《轮回帝经》,伴生法宝:天帝剑。依靠签到修仙系统,周庆镇压一个时代,再强的天骄都被踩在脚下。 随着实力越来越强,周庆发现,自己的来历,貌似并不简单。 原来自己前世就已经无敌了吗? 废柴人生,怎样脱胎换骨,意外开启阴眼怎样面对未知世界,请各位客官紧好孩子,拴好狗,备好啤酒瓶子易拉罐,瓜子花生羊肉串,耐心听老王我一一道来
三国:开局召唤盖伦 诸天最强村长 度魂刀笔师 玄幻:这个炉鼎太逆天 我是我老婆的前男友 归去龙兮 虚无之诸世界 失踪的贝乐之鼠猫之战 明斯亚战歌 丧尸海豹突击队队长 两个欢喜冤家 我是正经学生 阳星历 偏执大佬不好惹 地府直播日常 奇幻武侠 华佗救我 星际扫地机器人 究极无敌修炼系统 你最近好么 《开关》作文600字 【作文猜想十七】信任桥梁架起熟人陌生人鸿沟 《危急时刻》400字作文 08届高考作文 《开关》作文600字 《因为有了我》作文200 ……的日子里600字八年级作文 《那棵树》作文 《我家乡的环境》作文350字 04年作文题 08年广东高考作文题目 11规则 英语作文 “虎妞”也有善良的一面作文500 .读书的满分作文 07年江苏高考作文题目 …来了作文题目 ……的日子里600字八年级作文 《我家乡的环境》作文350字 【干货】2015.12四级作文预测5篇 140的作文 【作文猜想十七】信任桥梁架起熟人陌生人鸿沟 “奖品”话题作文 【空中观景】小学作文 【想起你我就 】优秀作文 .读书的满分作文 “虎妞”也有善良的一面作文500 《我家乡的环境》作文350字 【空中观景】小学作文 【干货】2015.12四级作文预测5篇 《我家乡的环境》作文350字 …来了作文题目 【作文猜想十七】信任桥梁架起熟人陌生人鸿沟 《拥有快乐》作文700字 140的作文 《雾》200 字作文 …来了作文题目 《拥有快乐》作文700字 ……的日子里600字八年级作文 “虎妞”也有善良的一面作文500 《拥有快乐》作文700字 …来了作文题目 ……是一首歌九年级作文 ……也是一种享受初中作文 11规则 英语作文 【想起你我就 】优秀作文 【作文猜想十七】信任桥梁架起熟人陌生人鸿沟 08年广东高考作文题目 …的三人世界作文 【探索】作文 07年高考作文题目分析 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欢喜谐谑曲 我往山上去 诸昏 神兽召唤师 青苏传 亚星管理平台 葡京官网 AG真人 亚星管理平台 万利游戏官网 《因为有了我》作文200 【探索】作文 08届高考作文 ……也是一种享受初中作文 《雾》200 字作文 140的作文 11规则 英语作文 《和你相遇在初中》 作文 08年广东高考作文题目 《拥有快乐》作文700字 07年江苏高考作文题目 …的三人世界作文 ……是一首歌九年级作文 《中考作文选》 …的三人世界作文 《因为有了我》作文200 04年作文题 《危急时刻》400字作文 《危急时刻》400字作文 【作文猜想十七】信任桥梁架起熟人陌生人鸿沟 08届高考作文 08年广东高考作文题目 【探索】作文 140的作文 ……也是一种享受初中作文 【空中观景】小学作文 .读书的满分作文 《中考作文选》 【空中观景】小学作文 《我家乡的环境》作文350字