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
日本电视剧阿幸讲父母年轻的电视剧征服孙红雷电视剧看不印度之夏2 电视剧王大陆2017电视剧呀日本电视剧阿幸冯远征徐帆电视剧征服孙红雷电视剧看不洪流电视剧中叶子结局刘涛和邓超演的电视剧虐女人的电视剧征服孙红雷电视剧看不关于岳飞的电视剧哪部好看虐女人的电视剧择天记电视剧结局落落刘涛和邓超演的电视剧百年的新娘电视剧全集快播电影电视剧车震搞基电影电视剧车震搞基有少奶奶的电视剧天生妙手电视剧电影电视剧车震搞基洪流电视剧中叶子结局电视剧多桑の纯萃年代然烧的青春电视剧全集伤感电视剧古装电视剧然烧的青春电视剧全集电视剧多桑の纯萃年代有少奶奶的电视剧关于岳飞的电视剧哪部好看繁忙的社畜生活需要一点调剂。 里面有好多好多的美人! 作者社畜一枚,工作繁忙,有些章节可能略短,但一定保证质量。祝各位看得愉快~世界遭到入侵,最强武道大帝力战而亡,重生在九千年后的世界,成了酒馆的店小二,并觉醒了全能系统。 通过系统,张易能够看穿世间功法、丹方和对手的缺陷。 为了抵抗即将而来的乱世,张易再次踏上修炼之路。 在他破格的实力下,对他心怀敬畏的人、闻名而至的人、求爱的人络绎不绝。 然而,就在他步步建造势力之时,那过去让世界陷入恐怖的危险,又开始在暗地里行动了……【幕后流】【金手指绑定】【反派】 一朝重生异世,随身携带系统,只要绑定天骄,就能不断变强,本该因此走上人生巅峰, 但是奈何系统过于坑爹, 不仅要使天骄不断变强,还要使他们走上对立面,防止气运之海崩塌, 这还好说,最让他不解的是,为什么,一个天骄死亡,他也要跟着消亡? 且看,主角如何将天骄玩弄于鼓掌之间,笑看天下风云。“你问我锦衣卫算什么东西?我现在告诉你,你们东厂不敢管的事,我们锦衣卫管。你们东厂不敢杀的人,我们锦衣卫杀。一句话,东厂能管的我们锦衣卫也要管,东厂不能管的我们锦衣卫更要管。先斩后奏,皇权特许!这就是锦衣卫,就问你们服不服?”一脸欠揍模样的林枫,指着东厂一群不男不女的太监吊吊的说到!”娘子,就是他欺负我!你揍他“说完这句话的白许,不由的想起几年前的那一切的开端,当时白许作为一名普通的小贩只想过平凡的生活,然而在一个风和日丽的下午,一天一群高大威猛的士兵突然过来掀了他的摊子,并把他绑走说要他成为公主的丈夫? 行星文明的尽头是升华还是毁灭? 站在行星文明的十字路口他会替人类做出正确的选择! 我有异世神瞳,看世间炎凉。魑魅魍魉,黑白无常,在这朗朗乾坤下,皆是我眼下亡魂。神瞳一开,我辨得人群中暗藏的鬼魅,也入得了坟墓,探异世孤魂。我没有职业证,不受法律约束,我自由游走地狱,不受阴阳限制。光脚的不怕穿鞋的,无证侦探管闲事,管他是谁,缉拿归案! 赵全,应用化学及治金双料硕士,毕业后学无所用,无房无车无女友,穿越后遂为赵瑔,江西铅山赵家庄里正之子,时逢南宋末年,宋廷上下偏安一隅苟且偷安,赵瑔以所学创业,引领宋人时尚风标,一步跨入富豪行列,计划趁大宋终结前乘船下南洋占个地方做“南阳村长”赵家庄之福引来盗匪垂涎,赵瑔不得不自建民团以自保,前世宅男从无逐鹿天下的雄霸之心,以“草根”为荣,但世事难料,为获取心仪女孩青睐,赵瑔剽窃伟人诗词以“才子”之名不胫而走,高薪聘请工匠得“奢遮小官人”褒誉。锲而不舍想泡美艳无双的白莲教天母,率民团连破白莲教数城。白富美愿以身相许,赵瑔大手笔招揽安置流民,大举开拓宝岛台湾。葛皂山灵宝天尊到场“以客座首席长老”礼待,朝廷封赐忠武节度使”,当赵瑔一步步被罩上光芒四射的主角光环时该何去何从?率领武装到牙齿的龙神军暴们下南洋占地当村长?指挥天下无二的强大帆舰称霸四海殖民东西半球?还是挥师北上笑看火枪对决弓马?他本是星辰帝国的太子,可谁料发生叛乱,让当时年仅8岁的他,父母双亡,经脉被废,从堂堂太子变为废物。他本以为这辈子都不能修炼了,所以一心求死,可是却遇到了一位老仙人。那老仙人不但让他住在自己的洞府里,还炼出神丹,让本是废物的他能重新修炼,甚至收他做了弟子,还将自己的女儿许配给了他...... 他定要在这片大陆掀起波澜,报仇雪恨......规培医生王磊应聘失败,却获得透视脏器能力,更有神级手术技巧。 幼儿误诊,即将死亡,王磊:我看到了,支气管断裂,马上手术。 主刀医生误伤主动脉,鲜血喷到天花板,王磊轻松搞定。主刀:幸亏王磊在。 农庄爆发奇怪病症,全市医生晕头转向,大佬:快去请王磊! 小小的乡卫生院逐渐成为世界医学中心,无数患者和名医云集于此,周边房价超过市中心。 这一切,都是因为一个人。
全球高武:刷怪成神,我打穿了人类禁区 末日乱世求生 全能小神农 诞生在海贼王的世界 灯花落尽 第八界:阎罗 蟑螂皇帝 别把岁月留下 武逆 创生纪元 爆炸王朝 诸天映上 大文豪加斯科因 破晓者也 星游手册 大衍噬元诀 那些年的深刻记忆 向光而生,我欲戴冠 我真的不是女装大佬 界脉天 好看的家庭苦情电视剧 哪些电视剧很黄禁播 百年的新娘电视剧全集快播 王大陆2017电视剧呀 好看的家庭苦情电视剧 非凡英雄 4电视剧 百年的新娘电视剧全集快播 蒙面检察官电视剧 伤感电视剧古装电视剧 电视剧宰相刘罗锅图片 日本电视剧2017最新 日本电视剧2017最新 国产电视剧 妻子出轨 哪些电视剧很黄禁播 日本电视剧阿幸 王大陆2017电视剧呀 2017年电视剧网剧 伤感电视剧古装电视剧 赵丽颖和演过的电视剧 征服孙红雷电视剧看不 哪些电视剧很黄禁播 择天记电视剧结局落落 赵丽颖和演过的电视剧 虐女人的电视剧 刘涛和邓超演的电视剧 国产电视剧 妻子出轨 伤感电视剧古装电视剧 讲父母年轻的电视剧 赵丽颖和演过的电视剧 伤感电视剧古装电视剧 王大陆2017电视剧呀 大地惊雷 电视剧3 印度之夏2 电视剧 日本电视剧阿幸 电视剧多桑の纯萃年代 王大陆2017电视剧呀 印度之夏2 电视剧 百年的新娘电视剧全集快播 国产电视剧 妻子出轨 择天记电视剧结局落落 然烧的青春电视剧全集 电视剧宰相刘罗锅图片 白雪花 电视剧 2017年电视剧网剧 虐女人的电视剧 大地惊雷 电视剧3 日本电视剧2017最新 然烧的青春电视剧全集 国产电视剧 妻子出轨 冯远征徐帆电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 救世与轮回 仙王赘婿 返祖我的先祖是曹孟德 养成柳神,我成为无上神帝 万武记 亚星官网 欧博游戏官网 万利游戏官网 欧博官网 澳门葡京游戏官网 天生妙手电视剧 择天记电视剧结局落落 蒙面检察官电视剧 美国电视剧007国语版下载 迅雷下载 关于岳飞的电视剧哪部好看 王大陆2017电视剧呀 好看的家庭苦情电视剧 国产电视剧 妻子出轨 电影电视剧车震搞基 虐女人的电视剧 王大陆2017电视剧呀 洪流电视剧中叶子结局 虐女人的电视剧 刘涛和邓超演的电视剧 日本电视剧2017最新 择天记电视剧结局落落 日本电视剧阿幸 电视剧宰相刘罗锅图片 讲父母年轻的电视剧 伤感电视剧古装电视剧 好看的家庭苦情电视剧 冯远征徐帆电视剧 然烧的青春电视剧全集 大地惊雷 电视剧3 伤感电视剧古装电视剧 日本电视剧2017最新 百年的新娘电视剧全集快播 王大陆2017电视剧呀 好看的家庭苦情电视剧 电视剧多桑の纯萃年代