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
同桌情侣头像一左一右貂蝉高清头像童鞋专卖头像手绘头像男背影图片大全集神探夏洛克 头像同桌情侣头像一左一右猫爆笑头像童鞋专卖头像头像读书帅气哥哥动漫头像输出两个字头像童鞋专卖头像双人西瓜女孩动漫头像卡通输出两个字头像迪丽热巴 头像黑白帅气哥哥动漫头像探探头像100受伤的动漫头像受伤的动漫头像动漫黑白吸烟男生头像霸气头像带字头像男生图片大全头像向右的受伤的动漫头像头像读书天秤座文字头像图片社会青年头像动漫双人可爱头像情侣头像叼烟男生霸气头像双人西瓜女孩动漫头像卡通猫爆笑头像同桌情侣头像一左一右滴!恭喜你创造出三国关羽,滴!恭喜你创造出恐怖木偶,滴!恭喜你创造出蜘蛛基因…………滴!恭喜你创造出恐怖游戏,齐天嘴角一笑:我是无敌的为《全民星》系列第四部曲:前三章分别为《全民星:星杰塔》《全民星:世界泡》《全民星:粉丝风波》为多人合作创作作品 内容有较多玩梗,同时并没有绝对龙傲天的人 ,且前三章并未上传到任何网站,仅私下群聊写过,但是这篇的内容已经是第四部了,很多角色在前三章已经无了。穿越到了一个全新的异世界, 在这个剑与魔法交织的世界里, 主角吕越点燃自己的斗气, 拳打异族,脚踢鬼神, 在血与火的试炼中, 吕越逐渐走向无敌他是国之重器,科研天才,国士无双! 她是国民女神,国色天香,迷倒众生。 重生到另一个世界的洛铭,激活了系统。系统给予的奖励条件为暗恋,暗恋时间越长,奖励越丰厚。 谨慎选择了自己的暗恋对象云雨蝶之后,经历五年时光,作为可控核聚变,空天航母,外骨骼机甲等高端科研项目总工程师的洛铭,载誉归来。 而他不知道的是,在不久之前,已经成为国民女神,甜美天后的云雨蝶竟然在歌手巅峰对决节目中向他表白了。 原来这个可爱的女神,也在暗恋着洛铭。 五年一别,五年暗恋,五年思念,再次相逢,这对神仙眷侣开始谱写传奇而甜蜜的人生!杨凡最近很倒霉。 还做怪梦,梦见已故多年的爷爷让他烧纸钱,收快递。 然后他便真的收到了一个寄件人是爷爷名字,寄出地址写着阴曹地府的快递。 从此,杨凡一边修仙,一边沉浸在烧纸的乐趣中,纸钱、纸人、纸车、纸别墅、坦克、飞机…… 对此爷爷表示非常满意,反手给他寄了一堆阴间特产,功法、丹药、法器、符箓、鬼物…… 爷爷:吾孙天纵奇才,有大帝之姿! 杨凡:不为别的,我只是孝顺而已!在未来世界,人类启动了基因革命,目的是让人类获得更加更加优越的生存环境 可是似乎事与愿违,在历史的长河中,这场革命终将被记录下来 而方舟似乎不是人类的方舟 灯塔不是人类的方舟的灯塔了 我们将随着时间,进入历史的长河 羽化飞升的周蒙没有成仙,却穿越来到了灵川大陆,灵魂附身在一个孱弱的少年身上。   人类是灵川大陆唯一无法炼气的生物,也是灵川大陆食物链的最低端的存在,还是众多兽族的口粮。   周蒙带着一身蓝星道法穿越,意外找到了人类修炼的法门。自身强化的同时还利用蓝星道法增强人类,居然能够使人族拥有无上实力。   周蒙以凡人之躯加冕人皇,带领人族崛起。   狼族:“区区人族而已,犹如蝼蚁,小指头足以捏死!”   狐族:“什么时候人类也能称之为威胁了?”   树族:“狗屁人类,我一巴掌一个好吧!”   人族开启修炼之旅,全员恶人之后。   狼族:“人族大佬们饶命,我愿意终生为人族当狗!”   狐族:“人类决不能留!”   蜥族:“啊?我蜥族被人族一巴掌一个了?”   扫清一干种族,成就万古人皇!!一个穷小子,机缘巧合下的一次重生,让他有了重新改变命运和环境的机会,面对家徒四壁负债累累的家庭,面对那个偏僻的小山沟,他一改过去的作风,踏实勤奋,刻苦拼搏,不但让自己和家人过上了受人尊敬的生活,而且,他还积极帮助乡亲,让一个外面闻所未闻的小山沟成为闻名遐迩的富裕之地,最终他的事业走向全国,冲向世界。本是万千普通人中的一员,竟遇古装女子流落小巷,一向宅男的曹烨把女子领进了家里,却不知道女子另有秘密。这部小说内所说的世界与现实世界毫无关联。并且主角们所处的世界为异世界。 一座与外界没有任何联系的神秘城市——MT-X,能够不断侵蚀着被动者的感情。然而,最大的问题还是——没人能够逃离这所城市。 这里有一所学院,只要满足学院的规则毕业的人,就能够逃离这座MT-X,到城市外“无忧无虑”的生活。 藤升流星,作为一个特嫌麻烦而且没有任何梦想的人,被这座城市侵蚀了感情。 为了寻找感情之物而踏入这所规则为「杀人」的学院。 等待他的究竟是纯真无邪的爱之情感,还是深恶痛绝的恨之情感。 一切都要从遇见他的邻桌——『凝玉花利』开始…
摸金秘闻 寻天界 重生敖丙之重振朝歌 我与怪族之间的故事 夜鹰侠1:魔枪之战 天生王侯 成为道士的那些事 诡仙儿 逍遥仙医人间道 赛尔号之命运交响曲 神探张天海 触灵怪谈 雨做的风 让你表演惊悚片,怎么全成真的了? 天域剑圣 魔格星囚徒 黑色乐园 魔鬼鱼海贼团 第一纨绔:我爹陪我穿古代 奶爸的背后是神明 动画头像冷酷 数字卡通头像 探探头像100 神探夏洛克 头像 动画头像冷酷 特种兵女头像图片大全 探探头像100 双人可爱头像情侣头像 张嘴人头像 双人可爱头像情侣头像一对 躺在草地上的死党头像 躺在草地上的死党头像 动漫抽烟头像情侣头像黑白图片 数字卡通头像 同桌情侣头像一左一右 神探夏洛克 头像 探探头像女高清 张嘴人头像 叼烟男生霸气头像 童鞋专卖头像 数字卡通头像 迪丽热巴 头像黑白 叼烟男生霸气头像 输出两个字头像 帅气哥哥动漫头像 动漫抽烟头像情侣头像黑白图片 动画头像冷酷 貂蝉高清头像 叼烟男生霸气头像 张嘴人头像 神探夏洛克 头像 数字7英文扣扣头像图片大全集 手绘头像男背影图片大全集 同桌情侣头像一左一右 天秤座文字头像图片 社会青年头像动漫 手绘头像男背影图片大全集 探探头像100 动漫抽烟头像情侣头像黑白图片 迪丽热巴 头像黑白 社会青年头像动漫 双人可爱头像情侣头像一对 同志群头像个性网 探探头像女高清 输出两个字头像 数字7英文扣扣头像图片大全集 躺在草地上的死党头像 社会青年头像动漫 动漫抽烟头像情侣头像黑白图片 猫爆笑头像 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 重生敖丙之重振朝歌 重生,自带无限技能 缓缓爱琴海 大明:家父永乐,永镇山河 地下十八层探险 澳门葡京游戏官网 AG真人 快连下载 澳门葡京游戏官网 欧博游戏官网 双人可爱头像情侣头像 动画头像冷酷 迪丽热巴 头像黑白 神探夏洛克 头像 社会青年头像动漫 天秤座文字头像图片 双鱼天蝎情侣头像 躺在草地上的死党头像 动漫抽烟头像情侣头像黑白图片 动漫黑白吸烟男生头像霸气头像带字头像男生图片大全 天秤座文字头像图片 帅气哥哥动漫头像 动漫黑白吸烟男生头像霸气头像带字头像男生图片大全 童鞋专卖头像 数字卡通头像 动画头像冷酷 叼烟男生霸气头像 社会青年头像动漫 双人西瓜女孩动漫头像卡通 猫爆笑头像 双鱼天蝎情侣头像 受伤的动漫头像 特种兵女头像图片大全 同志群头像个性网 猫爆笑头像 数字卡通头像 输出两个字头像 头像向右的 数字7英文扣扣头像图片大全集 双人可爱头像情侣头像