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
粉色头发头像高清图片大全粉二次元公主图片大全风景中带人物图片大全图片小学群名大全图片大全图片欣赏伤感头像非主流图片带字女生头像背影图片大全粉色头发头像高清图片大全非主流短发美女头像唯美图片大全风景中带人物图片大全图片校园3男漫画图片大全图片大全广西男女图片大全图片大全图片大全图片大全集灰色楼房图片大全图片大全图片大全图片大全图片欣赏粉色头发头像高清图片大全校服动漫男头像图片大全灰色楼房图片大全图片大全图片大全图片大全图片欣赏风景中带人物图片大全图片广西男女图片大全图片大全图片大全图片大全集身体长的狗的图片大全图片搜索霸气孤独的说说带图片大全霸气孤独的说说带图片大全生日蛋糕画的图片大全大图片校园3男漫画图片大全图片大全图片大全好看吉他的图片唯美女生头像图片大全图片大全初中萝莉可爱图片大全图片生活很美好的图片文字图片大全伤感头像非主流图片带字女生头像背影图片大全初中美女吻干动态图片大全集小学群名大全图片大全图片欣赏邪恶的男女图片大全图片生日蛋糕画的图片大全大图片校服动漫男头像图片大全网瘾少年林徉魂穿大武朝,凭借着网上冲浪的经历纵横武朝! 造纸?我会古法造纸; 赶海?这个季节的沙滩有很多花旦蟹; 行医?脸上出现蜘蛛斑,一抹无痕。 …… 因为受到连番打击而选择自杀离开这个世界,结果却意外带着记忆重生并且得到了一个开挂的系统,从此走向人生巅峰。天地之间灵气复苏人们纷纷觉醒了超凡力量,但是萧阳直到初中毕业之前都没有觉醒力量。直到他考上了高中他才发现了他真正的能力——考试,通过的考试越多就会变得越强。 ……命运多舛的少年,不谙世事的灵智,两者的结合在九州大陆掀起了阵阵腥风血雨。 在这里也许会看到华夏神话的延续,也许会看到超强的灵宝,也许会看到上古遗迹,也许会看到各种稀奇古怪的异兽,也许会看到魔之本相……这个人很懒什么也没有留下陈白凌在公司加班长达14个小时后终于在凌晨两点半一头栽倒,醒来后发现自己在一个洞穴里坐了三千年,让上一世社畜的他根本不能接受,推开洞穴的石头走到街上一番打听终于明白自己穿越了而且发现原主的发小变成女帝?修仙和历史共存,里面涉及的历史典故和俗语比较多。从梦中苏醒,游柏发现自己穿越到了《游戏王》的世界! 稀有卡什么的都是浮云! 唯有十年牌龄才是王道! 赢下各大顶尖赛事的冠军!登上决斗者的荣耀最高峰!成为海马濑人一辈子都想战胜的对手! “我!游柏!十年牌佬!从今天起将君临《游戏王》!”在开始阅读之前请务必要看这一段话 首先咱是新人,创作质量存在着很大问题,如果发现了什么问题的话,希望大家提建议,指正 第一卷的内容比较杂乱无章(但也和后文成呼应作用,改了好几遍,实在想不出什么好的串联在一起的方法),在跟着第二卷番外之后大概就解释了大部分的世界观了,后面就好一点,整体世界观比较大,和传统玄幻有着很大的区别(玄幻加科幻),大部分境界都是自创 前期看不出来,中期就会慢慢体现出这个隐藏的末世观念 小说内容有点无厘头,但大多后来都能解释,如果出现解释不了的,就在编呗(doge) 最后,嗯…… 看了一些对于小说的这个分析,真的不确定自己能不能坚持到最后,不过我会尽力的 也希望读者们能喜欢! 目前还在上学,更新也许会不稳定(暂时没这个问题,因为转站过来稿子还是很多的) 这是一个普通的故事,以个人为视角所经历的全部的历史……意外的死亡,沈子昂穿越到了洪荒年代; 废弃的血脉被人唾弃,驱逐! 没想到和自己一起穿越的狗都成为了魔族统领; 殊不知这废弃的血脉竟然是传说中的龙脉。 从此刻起,洪荒年代又多了一个疯狂作死的妖族大帝! “人族之皇啊,走着,去喝两杯?” “妖帝,你为何又要调戏我魔尊的女儿!!” “神王,咱俩去佛界溜达溜达,请他们吃烤肉去!!!” “师傅不好啦,妖帝要去做大保剑,问你去不?” “........” 四界大乱,上古妖魔复活; 妖帝死后魂魄不灭,附身于废柴之身; 一人持太古凶器,踏破苍穹,诛神斩魔!!!
莫名成神 重生之少年狂想 飞吧,实习医生 当红小花是我女友 走啊,不是说一起吗! 我当风神那些事 纨绔世子爷 灭尸运动, 第三人称观 每晚,一个诡故事 原神:我会无想的一刀 云顶之弈月神传说 都市地下大反派 巅峰之武道无双 长安斩妖录 马良之我是笔仙 残剑异闻录 诸天之劫:我欲通天 大国上医 庄周刘禅 带猫面具的女生动漫头像图片大全图片大全图片 钢琴儿童图片大全图片大全图片欣赏 身体长的狗的图片大全图片搜索 霸气孤独的说说带图片大全 带猫面具的女生动漫头像图片大全图片大全图片 邪恶超短美女动态图片大全 带动物的男头像图片大全图片 半边头的小孩图片大全 初中美女吻干动态图片大全集 校服动漫男头像图片大全 初中萝莉可爱图片大全图片 初中萝莉可爱图片大全图片 生活很美好的图片文字图片大全 广西男女图片大全图片大全图片大全图片大全集 带猫女生头像图片大全 伤感头像非主流图片带字女生头像背影图片大全 出来搞笑动态带字图片大全 初中美女吻干动态图片大全集 校园3男漫画图片大全图片大全图片大全 粉色头发头像高清图片大全 钢琴儿童图片大全图片大全图片欣赏 风景中带人物图片大全图片 粉二次元公主图片大全 好看吉他的图片唯美女生头像图片大全图片大全 半边头的小孩图片大全 生活很美好的图片文字图片大全 初中美女吻干动态图片大全集 粉二次元公主图片大全 校园3男漫画图片大全图片大全图片大全 初中美女吻干动态图片大全集 霸气孤独的说说带图片大全 钢琴儿童图片大全图片大全图片欣赏 小学群名大全图片大全图片欣赏 粉色头发头像高清图片大全 生活很美好的图片文字图片大全 伤感头像非主流图片带字女生头像背影图片大全 伤感女生漫画图片带字图片大全唯美伤感 带动物的男头像图片大全图片 生活很美好的图片文字图片大全 伤感女生漫画图片带字图片大全唯美伤感 伤感头像非主流图片带字女生头像背影图片大全 小婴儿女孩图片大全可爱图片 生日蛋糕画的图片大全大图片 出来搞笑动态带字图片大全 好看吉他的图片唯美女生头像图片大全图片大全 钢琴儿童图片大全图片大全图片欣赏 初中萝莉可爱图片大全图片 小学群名大全图片大全图片欣赏 生气的一个表情图片大全集 非主流短发美女头像唯美图片大全 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 守望:光与暗的对决 随便成为什么 乱世中的乐音 英雄联盟:王者之路 唯我超然 澳门葡京官网 快连下载 欧博官网 葡京官网 欧博官网 风景中带人物图片大全图片 霸气孤独的说说带图片大全 范冰冰苹果三级动态图片大全 灰色楼房图片大全图片大全图片大全图片大全图片欣赏 霸气孤独的说说带图片大全 校园3男漫画图片大全图片大全 好看吉他的图片唯美女生头像图片大全图片大全 半边头的小孩图片大全 出来搞笑动态带字图片大全 半边头的小孩图片大全 粉色头发头像高清图片大全 校服动漫男头像图片大全 带猫女生头像图片大全 邪恶超短美女动态图片大全 风景中带人物图片大全图片 身体长的狗的图片大全图片搜索 小学群名大全图片大全图片欣赏 身体长的狗的图片大全图片搜索 邪恶超短美女动态图片大全 出来搞笑动态带字图片大全 身体长的狗的图片大全图片搜索 带猫女生头像图片大全 出来搞笑动态带字图片大全 校园3男漫画图片大全图片大全图片大全 生日蛋糕画的图片大全大图片 校园3男漫画图片大全图片大全图片大全 半边头的小孩图片大全 带猫面具的女生动漫头像图片大全图片大全图片 半边头的小孩图片大全 伤感头像非主流图片带字女生头像背影图片大全