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
高考状元 小说 武功撕葱侠 小说穿越小说 女主穿越两个男主怀孕 产卵 小说小说h短黑 小说李贞贤 小说穿越小说 女主穿越两个男主地缚灵的童养媳 野猴儿 小说成长是种痛 石新 小说襄阳小说 合集高考状元 小说 武功被召唤小说求一本女扮男装 小说台言穿越小说 女主穿越两个男主成长是种痛 石新 小说关于张涛的小说初三冷枭的可口小情人 云希 小说冷枭的可口小情人 云希 小说倾城杀手后+茉筱兮+小说魔幻小说 排行冷枭的可口小情人 云希 小说地缚灵的童养媳 野猴儿 小说网游之都市传说 红狐 小说小说h短绝色杀手逆天三小姐 梦之涯 小说怀孕 产卵 小说小说 主角猎魔人 瞳术类似于 帝凰之神医弃妃 的小说被召唤小说一次爆炸将云舟意外送外大乾末年,天下纷乱,群雄并起,互相征伐,乱世如草芥。他人的路,他人的道,他人的信念,跟云舟背离时,他只选自己的路,自己的道,自己的信念,抉择自己的人生,不悔。 改朝换代,权谋攻伐,尔虞我诈,云舟试在天下破万法。分久必合,合久必分,终究沿着他的路一统天下。 从大乾、大宁,到大永,从北桓、西延、南离、到东贤,愿天下再无饥馑,再无乱战,再无不公。 樱花落在玫瑰园里,一场伺机而动的较量即将开始。虞朝十万年以来,各等修真家族层层把控修行资源,世人皆以为寒门再难出贵子的时候,孟浩然却是在暗中观察。 你们斗法,我种田……   你们打架,我囤货……   你们争夺,我抄底……   直到众人回过神来才发现,原本处于微末之中的孟氏一族已经逆流而上,步步为营,直抵巅峰仙家! 从失败者的角度看世界!因为太失败,才无所事事,才有更多无聊的时间……! 聊聊,关于失败的那些人,那些事!!!!!!!!在美丽的梦幻大陆上,分为三界,幻界,灵界和洛界,以九天之河三分大陆,三界争斗,长年不休,却又互相制衡。九天之河每百年现九天秘境,现九天之塔,九天之塔分九天,凡,普,灵,玄,皇,尊,圣,帝以及汣之天,传说闯汣天者得天下,九天之塔每一天都有不同的机遇,每一层都困难重重,每次闯关者都会获得相应的称号及奖励,然而千万年以来,还无人闯入九天之巅。幻界少主与洛界公主因九天之河倒流互相结识,因此展开两届世代之恩怨,两人之情牵动两届之争斗,然而灵界虎视眈眈,在暗中推波助澜,以收渔翁之利,离九天之塔开放还有8年时间,九天之争马上开始,看能否解决三界之乱,争夺九天之主。殊不知九天之巅,只有一把钥匙,一扇天门,上书《梦界》……预知后事如何,且看正文短篇故事小集锦林阳穿越三国,成为济世堂杂役,同时得到神医豪强系统,拥有现代医学仪器,开局直接震惊华佗,拜其为师! 曹操:林阳,你医术精湛,谋略竟然也如此惊人?真乃奇人! 诸葛亮:草船借箭,竟然借的都是火箭?林阳还是个人了? 孙权:林阳究竟是何许人也?竟然如此神鬼莫测! 周瑜:此人谋略在我之上,还把我的心上人小乔抢走了,哎,既生瑜,何生阳? 华佗:师父不仅医术天下无双,谋略更是天下第一! 三国群英:林阳难道是天选之子?竟然发明了这么多的远程火力?这岂不是天下无敌了? 林阳:咳咳,小老弟们,不要大惊小怪,都是基本操作! 本小说及人物纯属虚构,如有雷同,纯属巧合,切勿模仿! (轻松搞笑+海王+多女主+文抄公+迪化) 那一年……陈黎回到了17岁。 看着镜子中的自己,欲哭无泪。 生性散漫的他剪掉长发后,却像是变了一个人…… 他身披众多马甲,游离在万花之间。 众人对他的认知,始终停留在表象。 父母觉得他是软饭王! 美女觉得他是绝对的天才! 朋友觉得他是江湖大佬! …… 实际上,陈黎只想做一个真诚的人。 ps:本书又名《我的马甲有点多》、《我真的很专一》 只因发现了院长不为人知的秘密而被院长开除,重返武院后开始了和院长斗智斗勇的故事……先别感到无趣,这,只是我传奇一生的开始!本是千万富翁,却遭遇破产危机,结婚六年的妻子还送给我一顶大大的绿帽。 人生低谷,却无意间结识美女总裁。 为还自己清白,我重振昔日辉煌,不仅要手刃仇人,我还要让那些瞧不起我的人跪下来叫我爸爸。 人性是善是恶,争论千年无休止。 而我的故事就要从人性上开始说起…
都市神医奶爸 永恒之万界都是我的 克利西亚 作者交流群基地 我有9000万亿神豪基金 第一帝国:第一纪元 霍格沃茨的抽卡欧皇 我真不是王爷 我!酒剑仙,蜀山签到三百年 超凡:我体内寄居着邪神 血合 全职体验系统 关于冒险六章的那些事 关于我成为赘婿这回事儿 都市风流小仙医 弄哭同桌后,我天下无敌! 阴阳刺青 世界之罪!? 雷渊修罗 一首告别地球,全场笑喷 暗黑街 渥卡伍 小说 古代言情 小说大漠匈奴免费阅读 关于张涛的小说初三 冷枭的可口小情人 云希 小说 暗黑街 渥卡伍 小说 我是酸菜你是鱼 小说 好看的玄幻小说 肉 潜规则 小说周艳 绝色杀手逆天三小姐 梦之涯 小说 被召唤小说 地缚灵的童养媳 野猴儿 小说 找一本小说 关于养殖 网游之都市传说 红狐 小说 成长是种痛 石新 小说 黑 小说 小说h短 好看的玄幻小说 肉 绝色杀手逆天三小姐 梦之涯 小说 魔幻小说 排行 高考状元 小说 武功 古代言情 小说大漠匈奴免费阅读 穿越小说 女主穿越两个男主 撕葱侠 小说 求一本女扮男装 小说台言 成长是种痛 石新 小说 网游之都市传说 红狐 小说 绝色杀手逆天三小姐 梦之涯 小说 撕葱侠 小说 魔幻小说 排行 绝色杀手逆天三小姐 梦之涯 小说 小说h短 古代言情 小说大漠匈奴免费阅读 炮友 小说 高考状元 小说 武功 小说 主角猎魔人 瞳术 小说h短 炮友 小说 好看的玄幻小说 肉 网游之都市传说 红狐 小说 炮友 小说 小说h短 泰尼小说 倾城杀手后+茉筱兮+小说 找一本小说 关于养殖 求一本女扮男装 小说台言 古代言情 小说大漠匈奴免费阅读 地缚灵的童养媳 野猴儿 小说 怀孕 产卵 小说 类似于 帝凰之神医弃妃 的小说 李贞贤 小说 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 斗神主宰s 我有一剑冲星河 再上昆仑 全民制作大师横空出世 诡秘奇闻之少年占卜师 快连下载 亚星管理平台 亚星游戏官网 快连下载 亚星管理平台 冷枭的可口小情人 云希 小说 穿越小说 女主穿越两个男主 潜规则 小说周艳 求一本女扮男装 小说台言 找一本小说 关于养殖 李贞贤 小说 炮友 小说 古代言情 小说大漠匈奴免费阅读 魔幻小说 排行 小说h短 找一本小说 关于养殖 炮友 小说 穿越小说 女主穿越两个男主 找一本小说 关于养殖 成长是种痛 石新 小说 小说h短 冷枭的可口小情人 云希 小说 高考状元 小说 武功 穿越小说 女主穿越两个男主 求一本女扮男装 小说台言 古代言情 小说大漠匈奴免费阅读 手机侠小说 我是酸菜你是鱼 小说 高考状元 小说 武功 绑架王语嫣 小说 网游之都市传说 红狐 小说 好看的玄幻小说 肉 穿越小说 女主穿越两个男主 暗黑街 渥卡伍 小说 古代言情 小说大漠匈奴免费阅读