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
唯美动漫图片人物图片大全大图生活残酷图片大全唯美古装图片大全伤感的qq头像带字图片大全唯美少年背影伤感图片大全唯美动漫图片人物图片大全大图四个女生走路背影图片大全唯美古装图片大全微信封面男女拥抱图片大全外国帅男明星图片大全微信动态一车猪图片大全唯美动漫图片人物图片大全大图美女戴面具图片大全微信动态一车猪图片大全唯美古装图片大全外国帅男明星图片大全我成长我快乐的图片大全唯美少年背影伤感图片大全唯美少年背影伤感图片大全微信早上好早餐图片大全人手指心的图片大全微博情侣头像高清头像图片大全微信封面男女拥抱图片大全死神漫画的人物图片大全图片人月图片大全十二婚纱图片大全图片大全伤感的qq头像带字图片大全手绘简单的古服图片大全微信早上好早餐图片大全双鱼座形状图片大全碎叶城位于大陆的一个不起眼的位置,但北邻高山峻岭,南望平原,恰是个美丽富饶的好地方。   傍晚的碎叶城依旧人来人往、纸醉金迷,霞光普照更衬出这盛世华章。   只见一对十二岁的少年少女并肩走着,少年一头棕发束于脑后,英俊秀颖,微微上扬的嘴角显出其内心的自信与孤傲。少女留着一头美丽的长发,秀雅脱俗,一双如水般的眼镜淡然空灵。   少年名叫韩意是韩家百年难遇的天才,少女名叫听雨,是韩意的青梅竹马,两人自小便生活在一起,但却不是亲戚。   这时听雨朝着一个摆地摊的走了过去,原来她看上了一个用高阶妖兽身上的蓝色结晶做成的戒指。   “韩意、韩意快来看。”   “怎么啦?”韩意走了过来。   “你看这戒指多漂亮啊。”听雨说道   “确实很漂亮,这可是从六阶妖兽寒冰狼身上的结晶做成的,你很喜欢吗?”韩意拿着戒指摆弄着说道。   “是啊,是啊,你买一个送给我吧。”听雨说道,眼神中流露出渴望的神色。   “喜 欢 也 不 送 给 你!”韩意朝着听雨打趣道。   方铭入赘刘家三年,成了整个秦州人尽皆知的废婿。 一场诬陷竟意外导致他祖传玉佩被融合激活,方铭一朝觉醒,一双神瞳能鉴世间万物。 奇珍异宝在我手,古玩界里任遨游,纵横都市我为王。 方铭:“我真的只想安静的做个废婿!可实力真的不允许啊!”本文主人公文春水,是个高考落榜的农村青年。本文主要写了文春水坎坷的人生,和他缠绵悱恻的罗曼史。他多才多艺,文静儒雅,一表人才。他为人正直善良,但命运坎坷,爱情多磨难……一个世界走向毁灭的时候,就会诞生一个新的世界。被极东王国学院院长,捡回抚养长大的陈仒。没有能力而被抛弃,成为图书馆里员。 在平凡的度过四年后,一个小偷闯入图书馆把他杀害。本应已死的他,却诡异复活。 在被人一系列的设计后,卷入王国的权力斗争,以及和邻国的冲突之中。 期间失去了最近亲之人,同时卷入了更大的漩涡之中懒得下载日记软件了,就拿17k写日记吧。在这个世界,大部分人的身上都存在着名将,他们为了不灭和永生……何为仙,何为凡。 仙为何生来便高凡人一等,受凡人供奉,享人间香火,天上仙喜乐则凡间人得益,天上神恼怒则凡间蚁哀苦。 蓝星之上,流传着各式各样的神话传说,无人不知,无人不晓,但却无人真正见过这些传说中的神明。 那他们究竟存在是否。 是抛弃凡人而去,还是被封印在了某处,而那些神话究竟是有人随意编造,还是神明有意传播在世间? 科学证实的,便是真的吗? 在这个充满科学的蓝星之上,究竟还有哪些秘密没有被探索出来。 当一个来自外界的绝世大能满怀好奇的来到这个与众不同的星球,他带来的究竟是救赎,亦或者毁灭呢? 一个大学生,一个热门游戏,一次偶然的机会,大学生穿越到了游戏里的世界,在这个熟悉又陌生的游戏世界里,他凭借着自己的智慧,一步一步的变强。而在一步一步的前进路上,却发现原来游戏的背后,竟然隐藏着一个惊天大秘密,而这个秘密跟某个神秘组织有关,是孤芳自赏还是挑战命运呢,男主角和他的伙伴们该何去何从,敬请期待。教室上课上的好好地,一枪击案竟在学校发生?! 老师同学全杀,学校血流成河;顾曜煜火纹案觉醒,校园主角团立下誓言:定扭转时空,拯救世界! APRP组织的阴谋,恶魔的血眼悄然睁开。 世界的未来,是什么呢......
最后,我们终能相见 小爷我不是公子 定命时代 小达不会飞 巨变的世界 昱皇大帝国 CNC苍蓝暮光 灵气再现 我没想捉鬼 王女佣兵团 青苏传 天纪:靖帝本纪 我放弃高考去了异界 永夜 小总裁老司机 洪荒最强道承之欺师灭祖 不灭神枪 共神天下 穿越之我在西游卖军火 我夺舍了我的尸骨 生活残酷图片大全 外国帅男明星图片大全 我成长我快乐的图片大全 唯美少年背影伤感图片大全 生活残酷图片大全 手绘的猫咪图片大全 娃娃大全图片大全 帅气的抽烟漫画图片大全 手绘的猫咪图片大全 美女戴面具图片大全 无奈的女生图片大全 无奈的女生图片大全 死神漫画的人物图片大全图片 外国帅男明星图片大全 唯美动漫图片人物图片大全大图 人月图片大全 我的微笑的绘画图片大全 十二婚纱图片大全图片大全 人心残忍图片大全 唯美古装图片大全 胖女人头像图片大全 唯美古装图片大全 人心残忍图片大全 微博情侣头像高清头像图片大全 手绘搞笑情侣图片大全 人的皮肤黑图片大全 十二婚纱图片大全图片大全 人心残忍图片大全 人手指心的图片大全 十二婚纱图片大全图片大全 唯美少年背影伤感图片大全 胖女人头像图片大全 伤感的qq头像带字图片大全 唯美动漫图片人物图片大全大图 死神漫画的人物图片大全图片 人月图片大全 伤感的qq头像带字图片大全 娃娃大全图片大全 死神漫画的人物图片大全图片 外国情侣开心拥抱图片大全 人月图片大全 帅气的抽烟漫画图片大全 微信早上好早餐图片大全 我的微笑的绘画图片大全 微信动态一车猪图片大全 胖女人头像图片大全 无奈的女生图片大全 人月图片大全 人的皮肤黑图片大全 四个女生走路背影图片大全 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 神医胆子大,校花放产假 变频 外星球的村 梦的铃叶 我用太祖长拳在魔宗修仙 百度 百度 百度 百度 百度 我成长我快乐的图片大全 微博情侣头像高清头像图片大全 生活残酷图片大全 生活残酷图片大全 外国帅男明星图片大全 手绘搞笑情侣图片大全 唯美少年背影伤感图片大全 我成长我快乐的图片大全 帅气的抽烟漫画图片大全 人心残忍图片大全 死神漫画的人物图片大全图片 微信动态一车猪图片大全 双鱼座形状图片大全 手绘的猫咪图片大全 外国帅男明星图片大全 素描女孩侧面图片大全 微博情侣头像高清头像图片大全 微博情侣头像高清头像图片大全 生活残酷图片大全 生活残酷图片大全 胖女人头像图片大全 外国帅男明星图片大全 人月图片大全 微博情侣头像高清头像图片大全 手绘搞笑情侣图片大全 美女戴面具图片大全 我的微笑的绘画图片大全 微信早上好早餐图片大全 人月图片大全 手绘的猫咪图片大全 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网