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
歌词我和你之间反反复复小兔乖乖歌词 lrc歌词映照在太阳上面樱花草伴奏带歌词心型圈 蔡依林歌词意思歌词我和你之间反反复复情非得已 搜歌词歌词映照在太阳上面红雪莲==歌词自我欣赏 歌词相伴永远斯琴高丽歌词歌词我和你之间反反复复失去才懂得珍惜 山子歌词相伴永远斯琴高丽歌词歌词映照在太阳上面自我欣赏 歌词唱情歌十七岁的歌词鹿晗甜蜜蜜歌词鹿晗甜蜜蜜歌词青春舞曲完成歌词什么阿拉蕾歌词鹿晗甜蜜蜜歌词红雪莲==歌词儿童歌曲小小的船歌词心型圈 蔡依林歌词意思歌词 雪莲花 雪莲花樱花草伴奏带歌词花桥流水男女歌词草原夜色美 lrc歌词失去才懂得珍惜 山子歌词本以为开局即结束的我,却在无意间打开了另一个世界的大门,门的背后是无尽的恐惧和无尽的黑暗,而我将在这片黑暗中闯出一片天!世界黑暗的一角,禁锢万族的枷锁,缓缓揭开了.......一座危城,一条老街,一个念想,一个人,一群人,守一城。 陈枫重生异世,在最弱小的时候得到了一群最善良的人的帮助,为了一个念想守住一个城。守西北,入中京,踏塞北,这一世,希望可以活成自己想要的模样。讲述命运的故事嘿,我回来了……唐虞帝国现在百岁老人越来越多,而他们的故事正随着时代的迅猛发展而被遗忘。为此,收集整理他们的故事就成了一项重要事宜。作为为老服务的从业者,每天都和他们进行交流,倾听心声,记录百岁老人的故事,收存他们的健康之道,还有他们的笑声与苦恼……。于是《百岁福》就此诞生!大道唯我,无论道佛,一心为本,自在由我。 36位仙帝掌控仙域,瓜分世界果实强大己身,仙帝非圣贤,欲突破桎梏探索域外,仙域大乱,仙帝陨落。 且看叶林在机缘巧合之下获得魔尊残魂相助,最终踏上一段奇幻、动人心魄、荡气回肠的寻仙之路。 管你是神是佛,如不臣服,诸神灭佛。“叮!最强僵尸系统绑定中……” “系统绑定成功,使用者:叶晨(初级白僵)!” 一觉醒来,叶晨穿越到了僵尸先生电影世界里。 别人穿越不是尸祖就是尸王,可叶晨却发现自己变成了一只最弱的白毛僵! 在这个道士和僵尸并存的世界里,处处潜藏着杀机。 为了增长实力,叶晨掠夺中品养尸地,击杀任老爷获取系统丰厚奖励。 步步为棋,逆天改命,最终成就至尊尸神之位!陈怀安穿越成越国皇子,看他凭借签到系统如何种田发育,最后横扫天下,一统大陆,可是谁都不知道,他其实并不想当皇帝,一切都是被逼的。由于灵仙大陆发生战乱,男主角陈潇被卷入与地球平行的异界大陆,历经魔修大陆、蛮荒大陆、屠龙大陆、死亡国度等几片大陆,研习魔法、修炼仙术,经历了亲情、友情、爱情的考验,最终创建了自己的一片天地……
带着师妹讨生活 灾变日记 从普通人到先生 少年侠客梦 在异界的一二三事 搞钱,师弟不开玩笑 仙道圣尊 夜鹰侠1:魔枪之战 作者交流群基地 我的七个师姐貌美如花 你秀了我一脸 穿越之大侠宋青书 剑冲九霄之绝对领域 异界绘旅人 末日世界的蔷薇 Mc乱世 无限大陆发展史 转生后变成自动贩卖机 史上第一败家子 谜书 兵马俑朗诵歌词 红雪莲==歌词 花桥流水男女歌词 情非得已 搜歌词 兵马俑朗诵歌词 心型圈 蔡依林歌词意思 花桥流水男女歌词 什么阿拉蕾歌词 樱花草伴奏带歌词 小兔乖乖歌词 lrc 草原夜色美 lrc歌词 草原夜色美 lrc歌词 周杰伦的双节棍的歌词 红雪莲==歌词 自我欣赏 歌词 情非得已 搜歌词 儿童歌曲小小的船歌词 樱花草伴奏带歌词 歌词我和你之间反反复复 30年后50年后的歌词 红雪莲==歌词 左左右右 左右手歌词 歌词映照在太阳上面 mc天佑喊麦一人我饮酒醉歌词 歌词里有心中只有你 周杰伦的双节棍的歌词 樱花草伴奏带歌词 歌词映照在太阳上面 歌词我和你之间反反复复 歌词 雪莲花 雪莲花 鹿晗甜蜜蜜歌词 诚而通歌词 樱花草伴奏带歌词 歌词我和你之间反反复复 儿童歌曲小小的船歌词 心型圈 蔡依林歌词意思 兵马俑朗诵歌词 mc天佑喊麦一人我饮酒醉歌词 儿童歌曲小小的船歌词 兵马俑朗诵歌词 心型圈 蔡依林歌词意思 左左右右 左右手歌词 青春舞曲完成歌词 李叔同的送别歌词歌曲 周杰伦的双节棍的歌词 诚而通歌词 红雪莲==歌词 樱花草伴奏带歌词 草原夜色美 lrc歌词 情非得已 搜歌词 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 神奇宝贝之布卡 幽灵兵王在都市 不安的骷髅 从龙族开始拯救世界 今天又是在师门垫底的一天 皇冠登3出租 澳门葡京游戏官网 澳门葡京官网 百家乐官网 亚星官网 锦绣江南歌词 周杰伦的双节棍的歌词 小城雨的歌词谁唱的 樱花草伴奏带歌词 红雪莲==歌词 自我欣赏 歌词 樱花草伴奏带歌词 花桥流水男女歌词 什么阿拉蕾歌词 小兔乖乖歌词 lrc mc天佑喊麦一人我饮酒醉歌词 红雪莲==歌词 情非得已 搜歌词 锦绣江南歌词 20世纪的少年歌词 30年后50年后的歌词 mc天佑喊麦一人我饮酒醉歌词 鹿晗甜蜜蜜歌词 失去才懂得珍惜 山子歌词 兵马俑朗诵歌词 李叔同的送别歌词歌曲 自我欣赏 歌词 花桥流水男女歌词 锦绣江南歌词 左左右右 左右手歌词 失去才懂得珍惜 山子歌词 相伴永远斯琴高丽歌词 李叔同的送别歌词歌曲 小城雨的歌词谁唱的 歌词 雪莲花 雪莲花