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
个人所得税软件v3.0陕西视频格式化转化软件下载小白一键重装系统软件官网怎么使用网页自己的下载软件高清图片看图软件设计平面效果图软件下载淘宝删除图片空间软件下载小白一键重装系统软件官网在线把照片变成卡通软件iphone破锁软件高仿苹果安装软件个人所得税软件v3.0陕西有没有免费的定额软件10.1越狱必备软件源小白一键重装系统软件官网iphone破锁软件coffee办公软件电脑版高程计算软件电脑版高程计算软件灰度图 制作软件字体怎么软件下载电脑版高程计算软件在线把照片变成卡通软件蓝灯电脑软件高清图片看图软件金兰头条营销软件怎么使用网页自己的下载软件搜索压缩包的软件photostory软件下载有没有免费的定额软件宇宙悄然变化,地球的模样逐渐变得和往日不同,丧尸,怪兽,变异人如同雨后春笋般涌出。每个生命个体都在进化着,地球变了?不这就是他真正的模样。《飞龙乘云》带你回到夏朝末年,感受当时八方诸侯背叛,四藩异族作乱的动荡年代。看主角们如何面对忠义难存的局面,又作如何选择。本书不仅以夏朝为背景,还收录了大量神话故事、历史典故作为故事展开的桥梁,更以漫画般的手法描述激烈的仙术秘术激战场景,还有尔虞我诈的宫廷斗争、江湖侠义的恩怨情仇等一系列热血、谋略、兵道、爱恨尽归此书!欢迎大家以一个开放的心态来收看。 少年被家族遗弃,遭受刺杀修为被废。 危难之际开启镇魂世界,神秘女子百般磨练,终修剑道。 自此修行坦荡,领悟无上剑道,修不灭剑体。 修武技,破苍穹,入圣域,掌握天下权,醉卧美人膝,翻手为云,覆手为雨, 轻挥手中剑,剑出移山镇海,诸天星辰陨落,横断八荒四野; 九洲雷霆动,剑气侵万古,临绝世剑神。听说吕布死后超级猛一封邀请函中埋藏了几千年的阴谋,九死一生的鬼校中没有置身事外,处处血流成河。一念之间定生死,百人齐心决成败。华国,罗斯国,印国,东洋国,澳国,五个大国面临前所未有的危机。却不知这一切,只是决战前夕。 他本来是世界顶尖杀手组织的王牌,精通枪械,医术,格斗,杀人术,却在一次任务中惨遭暗害,死后重生到了民国时期,又能在民国之中摩擦出什么火花呢?陈羽本是一名国家击剑运动员,参赛无数,荣誉无数,奖杯一面墙都摆不下。却在一次比赛中,面罩意外脱落,对手剑尖直指右眼,刹那间,天昏地暗,当他再次睁开眼,已是开元年间…二十年前,一场大火,父母双亡,与妹妹分离。 二十年后,接到刺杀任务,在战斗过程中,猜测目标是和自己分开了二十多年的妹妹。 因为这个猜测,导致任务失败,受到组织惩罚,“意外”死亡。 重生后,在成长路上,发现了二十年前的那场大火里,还隐藏着不为人知的秘密……【迪化】+【无敌】+【搞笑】,叶凡穿越到修仙界,经过千辛万苦方才踏入修仙一道,本以为自己只是个刚刚踏入修行的炼气境小修士,殊不知他早已无敌,外面的修士见了他全都尊称一声前辈.......叶凡表示有些懵逼,原来练气境也可以无敌于世间.........冯宇熙生活在精灵世界,这里有各种神奇的精灵,等你来收服
满级悟性的我只是个渣渣 2122星球远征 回忆那几年 剑尊他一穷二白 齐天玄神 梦囚天 极光会的自我修养 江海山的故事 乡村玄学大师 小僧无花 开局被甩我的神豪系统激活 生命邪奏曲 白云历险记 黄玫瑰的罪刑 超神御兽师 大秦:一剑开天门,被金榜曝光了 苍生令:万族之主 女总裁的妙手狂医 对话先贤:开局打造神明禁区 天源仙农 有什么p图软件的贴纸 下载装饰照图片软件下载 coffee办公软件 电脑版高程计算软件 有什么p图软件的贴纸 安卓手机上软件一直显示等待中 能查看psd文件的软件下载 可以u盘安装的xp系统下载软件 金兰头条营销软件 有没有免费的定额软件 在线把照片变成卡通软件 一维条码制作软件podod 蓝灯电脑软件 iphone破锁软件 设计平面效果图软件下载 高清图片看图软件 能查看psd文件的软件下载 金兰头条营销软件 字体怎么软件下载 个人所得税软件v3.0陕西 下载装饰照图片软件下载 小白一键重装系统软件官网 视频格式化转化软件下载 10.1越狱必备软件源 iphone破锁软件 蓝灯电脑软件 金兰头条营销软件 视频格式化转化软件下载 字体怎么软件下载 金兰头条营销软件 高清图片看图软件 下载装饰照图片软件下载 用友软件数据库破解版 个人所得税软件v3.0陕西 搜索压缩包的软件 高清图片看图软件 用友软件数据库破解版 能查看psd文件的软件下载 蓝灯电脑软件 用友软件数据库破解版 高清图片看图软件 一键还原软件会改变原系统 灰度图 制作软件 一维条码制作软件podod 10.1越狱必备软件源 下载装饰照图片软件下载 在线把照片变成卡通软件 怎么使用网页自己的下载软件 photostory软件下载 淘宝删除图片空间软件下载 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 斩神灭仙传 万界:通灵 励志事务所的创办记 安神记 都市之狂帝归来 欧博游戏官网 百家乐官网 亚星管理平台 欧博游戏官网 亚星管理平台 字体怎么软件下载 glyphs字体设计软件 有没有免费的定额软件 搜索压缩包的软件 glyphs字体设计软件 能查看psd文件的软件下载 安卓手机上软件一直显示等待中 一维条码制作软件podod 10.1越狱必备软件源 diy动画头像制作软件 10.1越狱必备软件源 个人所得税软件v3.0陕西 高仿苹果安装软件 视频格式化转化软件下载 可以u盘安装的xp系统下载软件 有什么p图软件的贴纸 个人所得税软件v3.0陕西 安卓手机上软件一直显示等待中 有什么p图软件的贴纸 电脑版高程计算软件 金兰头条营销软件 蓝灯电脑软件 高清图片看图软件 photostory软件下载 安卓手机上软件一直显示等待中 设计平面效果图软件下载 能查看psd文件的软件下载 可以u盘安装的xp系统下载软件 一维条码制作软件podod 小白一键重装系统软件官网