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
网易公开课视频软件免费继续教育刷课时软件商国gps软件下载截面矩计算软件社区居民管理软件网易公开课视频软件汽修厂免费软件商国gps软件下载全球鹰现货分析软件办公室布局设计软件 免费下载有没有删除空红包的软件下载网易公开课视频软件广发证券期权宝仿真软件软件类大气宽网页商国gps软件下载办公室布局设计软件 免费下载什么软件可以滚动式播放器看图软件找相似图片看图软件找相似图片苹果回天数据恢复软件免费版vs视频剪辑软件看图软件找相似图片全球鹰现货分析软件32位识别内存软件社区居民管理软件钢管架搭设计算软件截面矩计算软件世窗身份证采集软件.exeios 6 版本软件下载广发证券期权宝仿真软件“乐极山”——世界的最高处。它气势逼人,令人望而生畏。传闻在那乐极山之后便是快乐的天堂,没有饥饿、痛苦、寒冷的地方,更重要的是:在大山之颠,矗立着一把能够杀死魔王的神剑! 可是到达山顶的人却是屈指可数,没有人知道失败者去了哪里,成功者到了哪去。可那仙境的诱惑,帝王的悬赏和能够斩杀魔王的力量仍然吸引了无数来访者。 上代勇者,堂滉便是其中之一。 那时的他血气方刚,拥有异人的力量与胆识,一手斩魔剑无人能敌,能只身在魔王军中杀个七进七出。同时,他还是一位浪漫的诗人,留下了数不胜数的令少女春心荡漾令少男热血沸腾的诗歌,甚至还在人类世界掀起过一阵诗歌热。 可是,他给世人留下了唯一的子嗣后便带领一众热血爱国者踏上了去“乐极山”寻找那能斩杀魔王的神剑的路,并再无音讯。 用音译法翻译过来后,他的子嗣名叫堂初清—— 菩萨低眉,所以慈悲六道! 撒旦低头,所以血流成河! 以撒旦之名,专职杀戮,他要当最强的那个男人! 最燃的都市,且看一个男人如何成就霸业,成为傲立巅峰的一代传奇!   【七少出品,铁血霸气】 撒旦军团群:198247503 匚系统提示,假如你有机会穿越到三国选义父,你会选择谁,是汉室宗亲刘备,还是汉贼曹操,或是江东孙权,你会选择谁呢?]重生战国末年,白仲成为秦国攻打赵国战场上的一个新兵。 正值嬴政横扫六合,统一天下之时,战乱频起。 白仲获得战神系统,杀敌就能变强,杀敌就能立功封爵,走上人生巅峰。 依靠秦国的军功爵位制度,白仲从一个新兵,通过不断杀敌,立下无数军功,成为大秦百万锐士的统帅,兵锋所过,六国俯首。 王翦:白将军一人,可抵千军万马。 蒙恬:白将军却匈奴七百余里,胡人不敢南下而牧马。 王绾:白将军,血手人屠,嗜杀如狂,每战必血流成河,尸横遍野,有伤天和。 六国贵族:秦有白仲,我等复国无望! 嬴政:白仲,寡人之武安君白起。 白仲:我比白起还要凶残!刚结束王者直播的林灿,突看到自己的右手臂上浮现出一串血红色牛头状的数字倒计时! 再睁眼时,已然置身于【猎梦惊悚游戏】 凝聚了位面的意志而生的主人公混沌之灵,在兄长们与姐姐的嘱咐下踏入了他的旅程,犹如婴儿一般刚接触到这个世界什么也不懂的他,在未来的旅程又有什么样的困难在等着他呢.....白原因意外穿越到了吉朝,从小要想当兵报效祖国的他,将会在这吉朝改变他怎样的人生。除奸臣,北伐等一系列故事前世的歌手李一峰重生平行世界。面对的第一件事竟然是离婚。好吧,好聚好散。 “李一峰你的老婆被人欺负了”。 什么?这能忍?帮助老婆制作专辑横扫歌坛。 “李一峰你的前妻被人称为票房毒药”。 什么?那是剧本不行,关我老婆什么事。帮助老婆夺得影后。 “李一峰,你天后老公的身份要暴露了”。 啊,这是什么时候的事啊! 后金铁骑灭宋,历史拐弯进入刘氏文朝。文昭帝五十二年,内忧外患,左相专权当道,宗室萧墙。腐朽将倾,灭国亡种露端倪。 懦弱书呆子杨继业在荆蛮楚地意外转性,文武并行,带领蛮族军一路前行。破山贼、剿倭寇、东控海贸、北撼蒙匈;内权肃奸、强兵兴武,皇权进村,国富民安,成就权相伟业,华夏一族登临世界之巅。 架空历史+商战+官场+战争+崛起  化神期老祖遭围攻陨落,带着一丝意识轮回转世,成为一代霸仙。仙林世界唯我独尊,看一代霸仙如何称霸整个修仙界……
执梦绘权 二次元之我的系统有点妖 缆镇语录 猎魔:美味佳肴 同世而立 灵域时代 当我变成了女生的这档事 雪啸炎海 大国重器智能时代 当码农遇上系统 潜生 再上昆仑 莲生涟 我在末世有栋楼 末日转职 不为谁而作的故事 都市之最强武帝修真者 欲摆烂李二不让 战神联盟穿越了之哥哥 我不想变得和它们一样 爱宝a12090打印软件 激活软件win8系统 什么软件可以滚动式播放器 看图软件找相似图片 爱宝a12090打印软件 洗车结算系统软件 软件考证app 爱宝标签打印机软件 钢管架搭设计算软件 广发证券期权宝仿真软件 全球鹰现货分析软件 u盘引导用分区工具软件 32位识别内存软件 办公室布局设计软件 免费下载 电脑管家软件升级关闭 社区居民管理软件 软件考证app 钢管架搭设计算软件 vs视频剪辑软件 网易公开课视频软件 激活软件win8系统 商国gps软件下载 免费继续教育刷课时软件 软件类大气宽网页 办公室布局设计软件 免费下载 32位识别内存软件 钢管架搭设计算软件 免费继续教育刷课时软件 vs视频剪辑软件 钢管架搭设计算软件 社区居民管理软件 激活软件win8系统 截面矩计算软件 网易公开课视频软件 世窗身份证采集软件.exe 社区居民管理软件 cdr12软件下载免费中文版 软件考证app 32位识别内存软件 cdr12软件下载免费中文版 社区居民管理软件 mp4转音频格式手机软件 苹果回天数据恢复软件免费版 u盘引导用分区工具软件 软件类大气宽网页 激活软件win8系统 全球鹰现货分析软件 截面矩计算软件 ios 6 版本软件下载 汽修厂免费软件 亚星游戏官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 卡恩的真实阿拉德之旅 我的那些陈年旧事 最强阴阳瞳 修学至尊 天成! 亚星游戏官网 万利游戏官网 欧博游戏官网 亚星游戏官网 葡京官网 cdr12软件下载免费中文版 世窗身份证采集软件.exe 爱宝a12090打印软件 ios 6 版本软件下载 汽修厂免费软件 办公室布局设计软件 免费下载 什么软件可以滚动式播放器 网易公开课视频软件 32位识别内存软件 网易公开课视频软件 激活软件win8系统 cdr12软件下载免费中文版 网易公开课视频软件 爱宝a12090打印软件 商国gps软件下载 看图软件找相似图片 广发证券期权宝仿真软件 看图软件找相似图片 截面矩计算软件 有没有删除空红包的软件下载 洗车结算系统软件 ios 6 版本软件下载 32位识别内存软件 爱宝标签打印机软件 软件类大气宽网页 爱宝标签打印机软件 视频剪接软件绿色 vs视频剪辑软件 爱宝标签打印机软件 cdr12软件下载免费中文版