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
一键申请qq号软件官网电脑版微信暴力加粉软件快速整理电脑文件软件笔记本隐藏录音软件微信清理僵尸粉的软件下载一键申请qq号软件官网dir反编辑软件下载快速整理电脑文件软件开学第一个课直播软件铺砖王软件手机版一款音乐软件点方块的一键申请qq号软件官网轰炸软件在哪一款音乐软件点方块的快速整理电脑文件软件铺砖王软件手机版一键清除空间留言软件下载微信清理僵尸粉的软件下载微信清理僵尸粉的软件下载百度云盘扩充软件真的可以练语文的软件下载手机电脑破解wifi密码软件开学第一个课直播软件产品化验 分析 软件手机极限压缩软件破解注册码软件name笔记本隐藏录音软件蒸汽物性软件百度云盘扩充软件真的如何练字的手机软件500年进行一次的宇宙大擂台赛,最后的胜利者可以为自己的星球在不断侵略的宇宙中赢得500年的繁华与和平,来自宇宙各个星球的参赛者将为自己的星球进行战斗。开局夺舍六耳猕猴! 道祖一句法不传六耳天下皆知! 几大量劫颗粒无收! 直至西游,被孙悟空一棒子打死! 周成慌了:不,我六耳绝不认命! 开天劫:截胡魔猿领悟战之法则! 龙汉劫:挫鸿钧斩罗睺开宗讲道! 巫妖劫:力压巫祖大兴人族! 封神劫:单挑三教平推昆仑山! 看周成从洪荒开始布局西游!逆天改命、以战证道!本书为原创长篇小说,分为两部。分别是上篇《亿兆富翁的百日蜕变》,下篇《亿兆富翁的二潜舰队》。 描写的是男主角“乌鸟炎”由都市普通人意外成为《亿兆富豪》栏目的幸运观众,从而开启了一段新的人生。就在那一天,一道光束照了下来,他改变了这个世界,改变了我,改变了我的生活 这个世界成了我的乐园,我却成了人类的先驱我的人生才经历过短短二十来年,但也足矣让写下我二十来年的第一部回忆录,回忆有苦有甜,苦中作乐。文青版:孤侠隐市井,愿为府中吏;朴剑表无华,寒光映残血;北国千里客,庆南有佳人;白衣映红雪,青丝落云肩;宁断侠剑意,今世不再离……剑兮侠兮,玉京三千客;情兮梦兮,伊在阑珊处! 直接版:我一个剑客,现在在庆南府做公务员,每天就是巡巡街,审审犯人。陈晓穿越大唐贞观初年,继承了家中位于长安东市的酒楼。 哪知那唐皇李世民化名李二哥,成了酒楼的常客。 推杯换盏之余,李世民的问题也越来越奇怪: “陈掌柜,突厥屡屡南下劫掠,可有一劳永逸的办法?” “陈掌柜,蝗灾荼毒天下,朝廷应当如何应对?” “陈掌柜,天下之大,我大唐铁骑如何能雄霸天下?” 陈晓有些头疼,我就一开饭馆的,你总问我这干啥? 关键是,大唐铁骑怎么还真雄霸天下了?“花有重开日,人无再少年” ,“天不生叶某,万古流长存”, 什么叶某的后宫团又吵起来了,叶某:“这可不管我的事,我可是个好男人。” 且看叶某如何带着选择系统征服白富美,拐骗美少女,混迹都市,一步步上人生巅峰, 叶某:“这叫用爱感化,这是真善美!!!!” ------------------------------------------------------------------------ 小林的第一本书,希望大家喜欢,也欢迎大家的批评与建议,小林会做的更好-------感谢各位!!!!!天下纷争,西京、启阳,北燕,鬼方四国争雄。西京国第一大江湖门派问刀门门主呼延燚,率天下门徒,纵横四海,征伐天下,无论是四国庙堂还是远涉江湖都无可避免地卷入其中。大唐缉妖司,专管天下精怪妖魔作乱。“只要是妖,就归我们管”在他们的努力下,大唐的天下日渐繁荣。
X世界的记忆 我们纯真的青春番外 异界牛马 探灵密录 居然有个高手 娱乐:开局疯狂爆料 都市绝品医神 告白与邂逅 旧世界消亡史 神荒笈 大明无敌熊孩子 我本不想做英雄的 山海闻道录 堕神的契约 原来我早就无敌了 逆下 小依不可爱 海德尔的血族 让你代管经纪公司,怎么都成巨星了 死亡回忆博物馆 电脑版微信暴力加粉软件 铺砖王软件手机版 一键清除空间留言软件下载 微信清理僵尸粉的软件下载 电脑版微信暴力加粉软件 英语三级四级软件下载 gta5安装破解版下载软件 金蝶迷你9.0软件下载 英语三级四级软件下载 轰炸软件在哪 做网络拓扑图软件 做网络拓扑图软件 产品化验 分析 软件 铺砖王软件手机版 一键申请qq号软件官网 手机极限压缩软件 网络做章软件下载 破解注册码软件name 清微信僵尸粉的软件 一键申请qq号软件官网 最好用的停车软件是哪个位置 快速整理电脑文件软件 清微信僵尸粉的软件 手机电脑破解wifi密码软件 金蝶迷你9.0软件下载 声音和文字互换处理软件 破解注册码软件name 清微信僵尸粉的软件 可以练语文的软件下载 破解注册码软件name 微信清理僵尸粉的软件下载 最好用的停车软件是哪个位置 笔记本隐藏录音软件 一键申请qq号软件官网 产品化验 分析 软件 手机极限压缩软件 茅台官网怎么下软件 gta5安装破解版下载软件 产品化验 分析 软件 茅台官网怎么下软件 手机极限压缩软件 iphone gps 怎么定位追踪软件 百度云盘扩充软件真的 网络做章软件下载 一款音乐软件点方块的 最好用的停车软件是哪个位置 做网络拓扑图软件 手机极限压缩软件 声音和文字互换处理软件 dir反编辑软件下载 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 最后一只龙 仙帝重生异世界之旅 磨天楼,破阵三界 时空穿越笔记 从红楼开始的诸天聊天群 AG真人 欧博官网 亚星管理平台 AG真人 皇冠登3出租 轰炸软件在哪 破解注册码软件name ios越狱后不能更新软件 iphone gps 怎么定位追踪软件 蒸汽物性软件 gta5安装破解版下载软件 快速整理电脑文件软件 电脑版微信暴力加粉软件 最好用的停车软件是哪个位置 最好用的停车软件是哪个位置 蒸汽物性软件 蒸汽物性软件 清微信僵尸粉的软件 一键申请qq号软件官网 产品化验 分析 软件 一款音乐软件点方块的 手机极限压缩软件 dir反编辑软件下载 百度云盘扩充软件真的 金蝶迷你9.0软件下载 gta5安装破解版下载软件 一款音乐软件点方块的 电脑版微信暴力加粉软件 如何练字的手机软件 一款音乐软件点方块的 ios越狱后不能更新软件 英语三级四级软件下载 英语三级四级软件下载 可以练语文的软件下载 清微信僵尸粉的软件