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
佛山真功夫电话唐山陨石馆电话白鹭洲电话网上订票电话订票时间限制乌鲁木齐买水电话号码是多少佛山真功夫电话新泰到威海汽车电话是多少钱白鹭洲电话凯里博雅电话西单路口新远景酒店电话靖江来一碗电话号码佛山真功夫电话南通南大街快递电话靖江来一碗电话号码白鹭洲电话西单路口新远景酒店电话烙馍村电话青岛保定公司客服电话青岛保定公司客服电话绿雅酒家电话号码岳西好声音前台电话郫县西御园电话黄岩电话区号宝应蓝精灵舞蹈电话乌鲁木齐买水电话号码是多少年之味电话号码网上订票电话订票时间限制烟台富士康家家悦电话绿雅酒家电话号码南通南大街快递电话赵玉虎,貌不惊人,瘦小枯干,巧舌如簧,能言善辩,这是一位彻头彻尾的小波皮,那真是老牛吃破草帽,满肚子坏圈圈,只有你想不到,没有他做不到,一天不搞点事情,浑身也不自在。 所谓面馍不坏不知酱味,粮不发酵难得美酒。世界上的事,好有好的道理坏有坏的理由,好戏还得坏人配,再好的作品,没有了坏角色的陪衬,也是没法表演的。 掌管异界与世界的混沌,千万年来都一直存在, 不管是人类或什至神跟魔族都畏惧着它过。 如果你对奇幻、异世界战斗类小说有兴趣, 那么这部综合各种战斗因素的小说将给你前所未有的新的体验。 与异界的混沌势力合作,深渊跟诸神跟魔王及人与人的斗争,还有古龙跟转生者。 一场场的战斗,一生只有李白的&amp;quot;纵死侠骨香,不惭世上英。 我以剑为道,斩尽诸邪万恶。 响往那太白所写的侠客之道&amp;quot;十步杀一人, 千里不留行,事了拂衣去,深藏功与名。 以及&amp;quot;纵死侠骨香,不惭世上英。 万物诸神皆可斩,不公不义不能服。 斩异端、斩群魔、斩外挂。然而我有个系统,却叫做聊天系统...楚凡获得了一个名叫主神的系统,从此开启了贸易诸天的旅程。 扛着五千万吨级的核弹和异界妖皇讲道理,真理只在核平之内! 上界十方仙帝围攻,楚凡反手掏出二向箔! 荒古圣体先天道体? 我直接提取细胞,复制上架! 什么?异界即将入侵? 我一个黑店老板,能发射智子很合理吧? 直接封锁异界天地法则,从此无人能突破大罗金仙! ...... “主神,我死后请把我的骨灰塞核弹里。” “为什么?” “身为炸天帮一员,哪怕我死了也要炸上天。” 这是一个黑店老板贸易诸天的故事,穿梭于诸天万界,和荒天帝称兄道弟,招楚子航当店内小哥! 主神出品,必属精品! 强买强卖,不服就干!虞朝十万年以来,各等修真家族层层把控修行资源,世人皆以为寒门再难出贵子的时候,孟浩然却是在暗中观察。 你们斗法,我种田……   你们打架,我囤货……   你们争夺,我抄底……   直到众人回过神来才发现,原本处于微末之中的孟氏一族已经逆流而上,步步为营,直抵巅峰仙家!几百年后的将来星际时代,原始星球上哪些愚钝的人把我们当成了神明,用自己的辛勤劳作祭祀我们!殊不知很快这些东西就会被打上包装销往银河系各地!各种阴谋诡计充斥的世界!就如同漆黑的宇宙! 一个倒霉的科学家被放逐到了这样一颗原始的星球遇到了同样是放逐犯的人群,他的未来会怎样呢?一切尽在超脱原始人生!寻觅宇宙真谛!亡灵降世,唤醒的是恐惧;教派逃避,引起的是分裂;帝国联盟,换来的却是勾心斗角。 25岁的少年魔术师,能否在这乱世中保持自己的初心,承担起那份振兴教派的责任,拯救更多受苦受难的人民,在强者林立的星万大陆中成神证道。 这个世界很冷,但也总有希望。 描述本人在一次机缘巧合的情况下穿越了自己的首创小说作品《仙剑跨世代》当中,亲身经历进行小说作品历程,在小说作品中本人担当着每一个角色的视角来找出作品中的软伤和硬伤的所有漏洞并想方设法更改的过程,从而达到回到自己所属世界的前提,可是就当本人经历千辛万苦迂回曲折的历程后准备回到自己所属世界的时候,令本人料想不到的情况却又再度发生……一个只有七岁的小男孩,没有任何修为。。。 一个凡人就敢叫板修炼者、最后差点死掉。。。 不被亲戚以及任何人待见的王无尘,晕倒在路边,被七彩宏光救醒。。。 撞见小姑被辱 激发无名怒火,唤醒七彩红光,使七彩发生变异,从此身高定格在一米六五。。。 被人侮辱、辱骂、各种各样的嘲笑都不在乎,就是不能触碰底线。否则,让你知道花儿为什么那样红。。。 宇宙掌控者阻挡我,我就撑破你的宇宙,把你的宇宙挤压成一团。 王无尘一步一步的建立门派,带领兄弟,踏着纨绔子弟、自以为是、狗仗人势的肩膀踏上修真界,踩着修真界、仙界、神界、圣界、虚无界、甚至宇宙掌控者的尸体,走上哪个高度,成为无上主宰妖魔乱世,鬼怪猖獗,大离皇朝动荡不安。 张韬一觉醒来,发现自己成为一名命不保夕的捉妖人。 妖魔图鉴,万物可辨。 凡是入手经过的妖魔鬼怪,都是不可多得的财富! 张韬惊喜发现,他竟然可以通过点亮妖魔图鉴,获取各种奖励... 阴冥之眼,九幽之瞳,换头术,赤霄真经,御神宝决,浮屠魔塔,九碑妖石,法相天地,长生不灭......“大秦算什么...寡人要率新唐的铁骑,打下一个大大的疆域!”躺在印第安部落内,手中摇晃着看不清颜色的酒杯,李承洲向着身边所有人郑重承诺!要替大秦守护江山不倒!前提..得是自己来做皇帝!自此,超脱数千年的大革命先从美洲大陆开始了!
战鹰战隼2 大逍遥主宰 人在西游写小说,圣人都来催更了! 神话复苏:我来册封东方神明 乡村公子 神眷战纪 阿怪新传 种梦 来,干杯 零神 往事如离梦 娘胎:开局觉醒幽冥魔体,女帝护道! 山村往事 光遇, 我的惊悚游戏实在太治愈了 蓝灵沐神 半步兵神 炎炎历险记 几望之城 大道天湮 大理下关水路维修电话 西单路口新远景酒店电话 烙馍村电话 青岛保定公司客服电话 大理下关水路维修电话 珠海u派酒店电话 恩施到贵阳的汽车电话号码是多少 越南大使馆签证处电话 年之味电话号码 南通南大街快递电话 黄岩电话区号 黄岩电话区号 宝应蓝精灵舞蹈电话 西单路口新远景酒店电话 城市名人酒店电话 乌鲁木齐买水电话号码是多少 郑州市金质大酒店电话 年之味电话号码 唐山陨石馆电话 佛山真功夫电话 吴川裕达酒店ktv电话 白鹭洲电话 唐山陨石馆电话 郫县西御园电话 越南大使馆签证处电话 宝应蓝精灵舞蹈电话 年之味电话号码 唐山陨石馆电话 岳西好声音前台电话 年之味电话号码 青岛保定公司客服电话 吴川裕达酒店ktv电话 网上订票电话订票时间限制 佛山真功夫电话 宝应蓝精灵舞蹈电话 乌鲁木齐买水电话号码是多少 顺风哈尔滨电话 恩施到贵阳的汽车电话号码是多少 宝应蓝精灵舞蹈电话 顺风哈尔滨电话 乌鲁木齐买水电话号码是多少 南方航空电话95539 绿雅酒家电话号码 郑州市金质大酒店电话 靖江来一碗电话号码 吴川裕达酒店ktv电话 黄岩电话区号 乌鲁木齐买水电话号码是多少 营口延吉高铁时刻表查询电话 新泰到威海汽车电话是多少钱 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 一颗陨石给我的力量 日照银河 莽起纪 三国:满朝文武全是穿越者 我的老婆是祸水 澳门葡京官网 快连下载 欧博官网 葡京官网 欧博官网 郫县西御园电话 乌鲁木齐买水电话号码是多少 郑州市金质大酒店电话 青岛保定公司客服电话 吴川裕达酒店ktv电话 恩施到贵阳的汽车电话号码是多少 西单路口新远景酒店电话 绿雅酒家电话号码 南方航空电话95539 绿雅酒家电话号码 大理下关水路维修电话 城市名人酒店电话 和县皇廷天下电话 顺风哈尔滨电话 新泰到威海汽车电话是多少钱 大理下关水路维修电话 恩施到贵阳的汽车电话号码是多少 新泰到威海汽车电话是多少钱 营口延吉高铁时刻表查询电话 烙馍村电话 凯里博雅电话 宝应蓝精灵舞蹈电话 凯里博雅电话 吴川裕达酒店ktv电话 唐山陨石馆电话 吴川裕达酒店ktv电话 网上订票电话订票时间限制 西单路口新远景酒店电话 珠海u派酒店电话 南通南大街快递电话