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
萍乡到清远坐那趟火车乌市火车站29路车的路线瑞金到会昌火车广州至上海 火车 路线查询系统开封火车站列车表萍乡到清远坐那趟火车保定到到泰州火车时刻表瑞金到会昌火车新城子火车昭通130到贵阳的火车票查询德州到蛟河火车站列车时刻表萍乡到清远坐那趟火车新余直达火车德州到蛟河火车站列车时刻表瑞金到会昌火车昭通130到贵阳的火车票查询青岛至曹县火车车次怀化至六枝火车时刻表怀化至六枝火车时刻表春运火车票一次性放完郴州火车站到湘潭的火车票多少钱网上买火车票哪个app下载火车票哪里自取渭南到西宁火车票查询开封火车站列车表扬州到菏泽火车票广州至上海 火车 路线查询系统保定到沈阳北火车春运火车票一次性放完新余直达火车道路漫漫,走着走着,走进一家神秘小店 仓促之间,毫无准备 突如其来的一个游戏人间的系统 选中如此单纯的我 但是我怎么可能会相信它的鬼话,可是它的任务实在是太无耻了 书中暗藏隐藏剧情:系统究竟有着怎么样的过去经历,到底是什么样的玄机暗藏在我周围 ------------------------------------------- 请大家持续期待阅读老书新更,欢迎大家评论区留言 ------------------------------------------- 反转反转还是tmd的反转,无耻是真tmd无耻啊 玄龙大陆,以武为尊。 少年叶平安得到败天武帝的至尊天眼,从一个卑微的蝼蚁,成为至高无上的绝世武帝! 一路上白骨累累,红颜多娇路飘摇,无敌路上太寂寥!金卷在手,天下我有! 文曲星下凡降世啦! 头脑简单,四肢发达的陈抟竟一夜之间成为文物双全之人?! 武曲星?文曲星 陈抟学渣的逆袭之路 架空历史,从古至今 敬请期待!天空突变,一次偶然的机会人类发现了比自己还强大的物种,贪婪的妄想却把沉睡千年的丧尸给惊醒了,不思考只听他人的人类征服选择了错误的选项差点毁掉世界,圣鹰小队能否侦破这起危机......在一个强者林立的世界,万亿物种生灵衍生,不断地突破自身,打破天理禁锢,追寻命运之根本,长生之久视! 一个平凡普通的人族少年,从一个小村落走出,搅动风云,气吞山河,开启一个新时代! 生活的点点滴滴、繁杂往事“如果说我甘于平凡,那我的心定然蹉跎。” “强大力量不是绝对,但定是最高级的话语权” 地球杨简,得神秘玉佩,穿越异界,以大梦悟道,以法眼破敌,修八九玄功,肉身成圣,在这一场灵气复苏,洪荒归来的大争之世。证道乾坤!天地妖魔邪祟入侵,万疆太平深陷祸乱的危险。 西谷刀岗点亮西域刀烛,南疆剑冢撑起万剑光涡。 北荒蛮子饮血啖肉,东海万族匪患无穷。 一个白袍少年,一头粉鼻白猪,一口鬼门四方棺。 自那大康王朝边境而出,闯入江湖。 多年以后,当其负手而立山巅,万邦臣服。 世人仰望,行那至高无上的棺子礼,万族默念。 棺子无敌。剑未妥,江湖早,纵使不懂,也不默,少年啊,不归呀,吾辈皆是英雄! 鸟惊忽现白马,飘飘锦衣落梨花,少年呀,归来呀,千年谁复重生?一剑动京华!
佛之手 灯花落尽 开局被雷公喷嚏劈死 超喜欢女装 朕继承大周赵大却黄袍加身 诡谈撰 人在末世?被迫造反! 大衍噬元诀 大魏青衣 我出生带有魔道圣体 星戒星神 雨落清秋 将乡 罪恶城下星净土 万界赎罪者 从夺舍开始的人生 阴魂书 在异世界闹革命 都市盖世神医 电子太极鱼 到伊春火车红星 昭通130到贵阳的火车票查询 青岛至曹县火车车次 怀化至六枝火车时刻表 到伊春火车红星 从银川站出发的火车 江都至宿迁火车时刻表 泗水去青岛的火车 扬州到菏泽火车票 新余直达火车 火车票哪里自取 火车票哪里自取 渭南到西宁火车票查询 昭通130到贵阳的火车票查询 合肥到宁波的有几点的火车票 开封火车站列车表 武安到衡水火车票 扬州到菏泽火车票 乌市火车站29路车的路线 萍乡到清远坐那趟火车 火车宝泉岭至哈尔滨 瑞金到会昌火车 乌市火车站29路车的路线 网上买火车票哪个app下载 泗水去青岛的火车 渭南到西宁火车票查询 扬州到菏泽火车票 乌市火车站29路车的路线 郴州火车站到湘潭的火车票多少钱 扬州到菏泽火车票 怀化至六枝火车时刻表 火车宝泉岭至哈尔滨 广州至上海 火车 路线查询系统 萍乡到清远坐那趟火车 渭南到西宁火车票查询 开封火车站列车表 从嘉兴到衡水的火车票 江都至宿迁火车时刻表 渭南到西宁火车票查询 从嘉兴到衡水的火车票 开封火车站列车表 茂名有没有火车到海口 春运火车票一次性放完 武安到衡水火车票 德州到蛟河火车站列车时刻表 火车宝泉岭至哈尔滨 火车票哪里自取 开封火车站列车表 西宁火车站到青海师大 保定到到泰州火车时刻表 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 医思 王者之最强组合 众神之主 忘川河下 夜港灯 AG真人 欧博官网 亚星管理平台 AG真人 皇冠登3出租 怀化至六枝火车时刻表 从武昌到荆州的火车票 德州到蛟河火车站列车时刻表 怀化至六枝火车时刻表 新城子火车 德州到蛟河火车站列车时刻表 泗水去青岛的火车 武安到衡水火车票 泗水去青岛的火车 萍乡到清远坐那趟火车 新余直达火车 合肥到宁波的有几点的火车票 从银川站出发的火车 瑞金到会昌火车 青岛至曹县火车车次 广州至上海 火车 路线查询系统 青岛至曹县火车车次 从银川站出发的火车 武安到衡水火车票 青岛至曹县火车车次 合肥到宁波的有几点的火车票 武安到衡水火车票 郴州火车站到湘潭的火车票多少钱 春运火车票一次性放完 郴州火车站到湘潭的火车票多少钱 泗水去青岛的火车 扬州到菏泽火车票 泗水去青岛的火车 开封火车站列车表 茂名有没有火车到海口