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
城堡蛋糕游戏大全城市速度小游戏大全城堡蛋糕游戏大全图片城市车司机游戏橙光穿越游戏有哪些城堡蛋糕游戏闯关课堂游戏城堡蛋糕游戏大全图片城市车司机游戏下载地址橙光游戏 在线试玩橙光言情小游戏城堡蛋糕游戏大全成语填字的游戏下载橙光完结游戏大全城堡蛋糕游戏大全图片橙光游戏 在线试玩闯关类农场游戏橙光的经典游戏橙光的经典游戏城堡大逃亡游戏视频城市施工车游戏橙光的经典游戏城市车司机游戏下载地址乘法口诀游戏闯关橙光穿越游戏有哪些城市纸牌建筑游戏下载城市车司机游戏乘法口诀游戏闯关澄光游戏试玩成语填字的游戏下载僧非僧,人非人。爱与恨,痴与怨,纵跨两千年,一个与众不同的江湖故事!宇宙星河   无尽虚空   凌驾于天道之上   掌管无尽宇宙   不被任何人打败   她就是墨星玄一个经历核战争后的高中生营救家乡龙港的故事。 随即而来的就是一阵冲击波和疯狂的气流。我看不见东西,但我现在身体感觉就像被卡车撞在墙上一样。全身似乎都受到了棒球棍的打击...... 这世界本来就是一剧你方唱罢我登场的英雄史诗,人人都有自己的故事人人都能成为故事的主角。而在现在,举世大乱,北方草原的天选之子诞生,他一步步坐上了可汗之位,在一路成为了漠北天可汗进而反抗命运争逐天下。而南方在一场天下震惊的叛乱后,各路反贼或是英雄也开始逐鹿中原。当漠北的天可汗携大军而下,南方群雄又被迫共御强敌,同时又各自心怀鬼胎,于是一场南北之战就此展开。同时在那场叛乱后,这块大陆上也出现了许多本该不属于此的事物,宛若腐朽枯木的巨人,仅剩枯骨的亡灵,一切都开始变得不同寻常。诸天万界,我人族曾屹立于巅峰。然,圣人逝去,山河染血,我兆亿同胞损失殆尽,几近灭族。 但我人族还在,纵使战至一兵一卒,纵使天塌地陷,我等不屈,我等不服。 我人族之魂还在,我人族脊梁不弯,为我人族而杀,为我人族而战,诸天万族,人族不灭。邪剑燕支的意外发掘,牵扯出一桩百年冤案。洛家长子洛知行中千机散之毒,危在旦夕。唯有找到退隐江湖的魔尊白苏子才能救他于水火。百年断点,熟悉的情节再度上演,真凶是否另有其人,洛薇、宫寞霖、夏无攸、郁雪吟为救知己洛知行,集结一方,踏上未知的征途。随着旅行的深入,那些不为人知的故事如抽丝剥茧,渐渐浮出水面……沈浪:划船不靠桨,全靠浪。 凭沈浪那个穷哈哈,他为什么能够得到互联网创业女神萧红绫的喜欢。 萧红绫:因为他是背后推我的男人。 凭沈浪那个穷哈哈,他为什么能够得到娱乐创业女神苏媚的喜欢。 苏媚:因为他是我背后用力的男人。 ………… 【震惊!恐怖的商业帝国创始人】系统傍身,杀一人,活一天; “以死神的名义,你必须死!” “以死神的名义,毁灭他们!” 死神:“呃...你不要坏我名声!”女娲创世之后身陨天地,临走之际将当初补天用的五彩神石交付于凤凰族的族长慕九云掌管,之后便由凤凰一族统领神界。神界由凤凰、青龙,玄狐三族组成,分别掌管海界、地界、天界。各自掌管三地。三族的族长关系一直很好,当年一起在女娲娘娘座下惩恶扬善。但因玄狐族长灵霄的贪婪设计,在其妹妹灵若烟与慕九云大婚之际将慕九云杀害。神界改天换地,灵若烟将神灵寄托五彩石,而慕九云却身陨忘川,之后因缘际会,二人重新转世。千年前的误会,在二人重新历经万难之后解开。但由于灵霄堕魔被闵天侵蚀,危害天下,两个人不得不在次分离。灵魂无意穿越到一名叫李斯的少年身上,不仅有着号称第一美女的未婚妻,还获得一个会吐神通种子的异兽,各种资源,美女,金钱如何选择,李斯:选择是小孩子的思想,而我是通通都要!
白棋?黑棋! 一只鬼眼里的世界 虚拟世界游戏之玩家降临 穿越之荒唐人生 废土从超级基地开始 震空 刚到玄幻之开局签到神体 我在异界创建裁缝军团 梦魇时录 都市逍遥医圣 武御群雄 逃不出黑暗 五行炼丹师 幻影毒魔 焚天之前 我的酒神女友们 武道修炼第一人 红尘符道 狂斧战神 张池的精彩人生 城市纸牌建筑游戏 橙光游戏 梦好沉名言 闯关类农场游戏 橙光的经典游戏 城市纸牌建筑游戏 乘法口诀计算小游戏 城市车司机游戏下载 橙光游戏7k7k梦好沉 城市纸牌建筑游戏下载 成语填字的游戏下载 城市车司机游戏下载地址 城市车司机游戏下载安装 惩罚恶心游戏 橙光游戏 在线试玩 城堡蛋糕游戏 橙光穿越游戏有哪些 城市车司机游戏下载 城市纸牌建筑游戏下载 城市施工车游戏 城堡蛋糕游戏大全 橙光游戏 梦好沉名言 城堡蛋糕游戏大全图片 城市速度小游戏大全 橙光完结游戏大全 橙光游戏 在线试玩 惩罚恶心游戏 城市纸牌建筑游戏下载 城市速度小游戏大全 城市施工车游戏 城市纸牌建筑游戏下载 橙光穿越游戏有哪些 橙光游戏 梦好沉名言 城堡蛋糕游戏下载 城堡蛋糕游戏大全 乘法口诀游戏闯关 橙光穿越游戏有哪些 城堡蛋糕游戏下载 闯关类农场游戏 惩罚恶心游戏 城堡蛋糕游戏大全图片 城市车司机游戏 成语填字的游戏 城堡大逃亡游戏视频 城市车司机游戏下载安装 橙光完结游戏大全 橙光游戏 梦好沉名言 城市车司机游戏下载安装 城市车司机游戏 澄光游戏试玩 闯关课堂游戏 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 请问逆袭犯罪吗? 破尽时空 我创造了最强惊悚世界 诡遇奇闻录 地球升维 万利游戏官网 欧博游戏官网 欧博官网 欧博官网 澳门葡京游戏官网 橙光穿越游戏有哪些 城市车司机游戏下载 乘法口诀游戏闯关 城堡大逃亡游戏视频 澄光游戏试玩 城市跑酷游戏视频教程 橙光言情小游戏 成语填字的游戏 城市施工车游戏 城市速度小游戏大全 城市施工车游戏 城市车司机游戏 城市速度小游戏大全 乘法口诀计算小游戏 乘法口诀计算小游戏 城市车司机游戏下载安装 闯关课堂游戏 澄光游戏试玩 橙光完结游戏大全 橙光游戏 梦好沉名言 橙光言情小游戏 城堡蛋糕游戏 城市车司机游戏下载地址 城市纸牌建筑游戏 城堡蛋糕游戏大全 城堡蛋糕游戏下载 城堡蛋糕游戏大全 承成人小游戏 城堡蛋糕游戏大全图片 橙光穿越游戏有哪些