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
济南打卡2000贷款月薪3000可以贷款多少济南正规贷款重庆民信阿里贷款签约后铜仁无抵押贷款济南打卡2000贷款限价房可以申请贷款吗济南正规贷款沈阳贷款 背账重庆博民贷款靠谱吗成都身份证贷款5分钟拿钱济南打卡2000贷款汽车贷款市场分析成都身份证贷款5分钟拿钱济南正规贷款重庆博民贷款靠谱吗房屋贷款30万铜仁民间贷款铜仁民间贷款贵阳银行工资卡贷款五户联保贷款被起诉铜仁民间贷款沈阳贷款 背账益阳汽车抵押贷款铜仁无抵押贷款新乡谁能贷款重庆民信阿里贷款签约后鞍山贷款无抵押10万淘宝月销量6万以上信用贷款汽车贷款市场分析龙峰,某特种部队退役后,一次乘坐游轮遇到飓风……醒来时,龙峰发现自己出现在一处岛屿的海滩。这处岛屿荒无人烟,里面处处杀机,有吸食血肉的树怪,还有身如巨山的凶兽……生存还是毁灭?龙峰开始了自己在异大陆的传奇人生。在一个偶然的机遇下,云雾生认识了一个神秘杠爷(盗墓贼),使他这个本是天煞孤星命的人,在东鲁巫师墓中得到三部天书中的“人”字部天书,从而走上了一条惊险刺激的逆天改命之路。贵南鬼母地宫中的地下民族;神秘的藏地第一代赞普(藏王)的神墓;大沙漠魔鬼城下诡异的地下古城;昆仑山上远古时代的天域之城。都留下了他的足迹,在历经无数的艰难险阻之后,他和他的伙伴们终于找到了,天、地、人三部远古时代遗留下来的的天书。更是赢得了人生中真正的幸福。无数的惊险与刺激尽在此书……谁说人无出头日? 隐忍数年的林知命霸道崛起,纵横都市,将所有曾经看不起他的人踩在脚下! 势利丈母娘?给我闭嘴! 豪门公子哥?给我跪下! 强大武术家?给我爬开! 女神级老婆?来,亲一个! 霸道是他的处事风格,不服就干是他的行为准则。 且看一代霸婿,如何上演逆袭后的彪悍人生! (请关注老施抖音号:1299243741,或者抖音搜17K老施) 吃喝闲侃而已。 人物剧情,纯属虚构。 如有雷同,纯属巧合。王富贵一觉醒来发现自己穿越到一个破落户家里,一出门还白捡了个老婆,为了养活一大家子,王富贵不得不想方设法搞钱!设计时装、建造工厂,到后来居然连手机都有了……王富贵就这么成为大夏第一号大富豪,还顺便收个皇帝做小弟!"三阴绝脉"者,史书所载;凡患此症者非但终生不能修武,并且几乎无一人能侥幸活过十三岁。命运关上所有的幸运之门,却开了一扇窗,令其在绝境中峰回路转,当其踏着尸山血海攀上巅峰之时,骇然发现一个惊天之秘。暮然回首,惊觉自己脚下的这片世界幌若恒河之沙粒,渺若微尘。何去何从……平行光与身边的朋友在学校发生的日常,本书仅供实验,如有侵权联系秒删 民国时期,我是拉洋车的,牛A的黑狗子探长刘麻子想强睡我的媳妇,被我制止。他带着大批的黑狗子对我用刑把我整死。阴间,我遇见大诗仙,向他诉说冤情,然后到冤魂村走一趟,才知道比我冤的人太多了。之后他把我变成了文化人,然后又把我穿越到了人间南粤市,让我抑恶扬善努力去做正能量的牛A人。此时的南粤市已是八十年代末期,我从打工做起,经历了开放大潮,凭着自己的能力为公司做出了很大的贡献,同时也收获了爱情。几年后,到处都在办报纸,我凭着自己的文笔混进报社当上了记者,通过采访工作,结识很多企业老板,在一次采访中,意外发现我生前认识的那个黑狗子探长刘麻子也被穿越到了这座城市,而且是下海经商混成了道貌岸然的董事长,被认为是红极一时的牛A人物。我悄悄跟踪,在我女友的配合帮助下,发现了他的一系列违法犯罪活动和伤天害理的事情,在掌握了大量的证据后,我凭着一腔正气,成功举报最终将其绳之以法。我终于成了正能量的牛A人!杨小乐在推销的途中,误入城市一间隐秘的房子,在听到一声秒针的哒哒声之后,脑海里传来一个甜美的女声。 :恭喜宿主成功开启无问系统。。。 从此主角的开挂人生正式开启,拥有了所有平凡人穷极一生也无法拥有的财富,美女,神功; 当他轻而易举的站在了世界的最高处,却看清了这个世界的真相。 :“我命由我不由天,如果天道不公,那我就换了你这老天!” 。。。前世,他的父母对他不冷不淡,沉默的性格让他没有朋友。但他在游戏中认识了一位师父——5719。是他教会了他好多东西,使他不再那样的菜,同时也改变了他的沉默寡言。但不久,他的师父死于癌症,而他也死于车祸。 这一世,他重生到了一颗叫蓝星的星球上,mc的浪潮刚刚掀起,为了纪念曾经黑白的记忆与磨难,他便将他的网名取为【黑白记忆】,而他,将用这个账号,创造出璀璨多彩的传奇! ———————————————————————————— 题材:我的世界X转世重生 更新频率:2~3天一更,节日或支持者众多加更,期中期末停更1~2周 MC版本:随剧情发展 QQ书友群建立了,群号745702129,闲聊杂谈唠嗑催更都可以! 未经允许,切勿擅自转载!希望大家多多支持!
孤帆远星 契能巅峰 辰世尊 超能异术:传奇忽悠苏大师 玉京封神战 都市极品天师 仙魔双宝的无双父尊 浩瀚无境 隋唐生活启示录 我的功法自带特效 我在末世种个田 戚明 斗破之天命神王 天魔之引 重生左冷禅之苟住不浪 漫威:从金刚狼开始 萧暮 武逆 何以通天 梧桐街凄凉花 买房贷款余钱放高贷违法 沈阳那家小贷公司贷款好 房屋贷款30万 铜仁民间贷款 买房贷款余钱放高贷违法 济南汽车二次抵押贷款 厦门民信有公积金贷款吗 宜昌市九合小额贷款有限公司 新乡谁能贷款 汽车贷款市场分析 沈阳贷款 背账 沈阳贷款 背账 益阳汽车抵押贷款 重庆博民贷款靠谱吗 济南身份证小额贷款 铜仁无抵押贷款 厦门民信有公积金贷款吗 新乡谁能贷款 五户联保贷款被起诉 济南打卡2000贷款 沈阳那家小贷公司贷款好 济南正规贷款 月薪3000可以贷款多少 建业小额贷款股份有限公司 宜昌市九合小额贷款有限公司 益阳汽车抵押贷款 新乡谁能贷款 月薪3000可以贷款多少 五户联保贷款被起诉 新乡谁能贷款 铜仁民间贷款 沈阳那家小贷公司贷款好 重庆民信阿里贷款签约后 济南打卡2000贷款 益阳汽车抵押贷款 铜仁无抵押贷款 蚌埠市公积金信用贷款 厦门民信有公积金贷款吗 益阳汽车抵押贷款 蚌埠市公积金信用贷款 铜仁无抵押贷款 蚌埠工商银行车辆贷款 贵阳银行工资卡贷款 房悦贷款抵押 建业小额贷款股份有限公司 沈阳那家小贷公司贷款好 沈阳贷款 背账 重庆民信阿里贷款签约后 淘宝月销量6万以上信用贷款 限价房可以申请贷款吗 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 死亡聊天群 飘浮于短暂清醒之上的城市 我和女总裁的荒岛生涯 我在末世的苦日子 精灵宝可梦之降临现实 欧博游戏官网 皇冠登3出租 百家乐官网 欧博游戏官网 欧博官网 超20年的房子贷款年限 济南正规贷款 宜昌市九合小额贷款有限公司 重庆民信阿里贷款签约后 济南正规贷款 房屋贷款30万 重庆民信阿里贷款签约后 建业小额贷款股份有限公司 房悦贷款抵押 宜昌市九合小额贷款有限公司 济南身份证小额贷款 汽车贷款市场分析 济南身份证小额贷款 济南汽车二次抵押贷款 济南正规贷款 房屋贷款30万 重庆民信阿里贷款签约后 房屋贷款30万 济南汽车二次抵押贷款 房悦贷款抵押 房屋贷款30万 济南身份证小额贷款 房悦贷款抵押 五户联保贷款被起诉 淘宝月销量6万以上信用贷款 五户联保贷款被起诉 宜昌市九合小额贷款有限公司 买房贷款余钱放高贷违法 重庆博民贷款靠谱吗 铜仁无抵押贷款