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
韩国悲伤电视剧排行榜电视剧有2017最新谍战剧电视剧大全啪啪电视剧禁播视频一千零一夜电视剧角色韩国悲伤电视剧排行榜但是电视剧36集团圆最新谍战剧电视剧大全拜托别黑我电视剧2父母爰情完整版电视剧全集电视剧人生如戏最新谍战剧电视剧大全电视剧射雕英雄传胡歌版演员表电视剧人生如戏演员陈数主演的电视剧父母爰情完整版电视剧全集神之?~电视剧漫画哪个更好大猫追爱记电视剧全集剧情介绍一千零一夜电视剧角色电视剧刑事侦缉档案2经典电视剧排行大猫追爱记电视剧全集剧情介绍拜托别黑我电视剧2菩提树下电视剧结局是什么暖男记 电视剧全集婚姻幽默的电视剧暖男记 电视剧全集风雨上海滩电视剧电视剧刑事侦缉档案2新版水许传电视剧全集大千世界,无奇不有,穿越古今,独占鳌头。 废材可以变龙凤,保安瞬间变豪侠,学渣一秒变学霸。 以此推论:那么,身为绝世宅男变成人中王者,应该完全没有问题。 在我们英俊潇洒,风流倜傥的主角&amp;lt;苏辰&amp;gt;眼里: 什么灭世魔君。。。什么阴阳判官。。。什么暗夜使者。。。 通通来我胯下受辱。。。不对。。。不对。。。是胯下受死。。。还是太不对。。。那么就来我剑下受死吧。。。进入这家书店时,摆在面前的只有两条路:是选择甘于现状,过着后悔不已的生活;还是选择把自己的故事讲出,换取截然不同的结局。你将如何抉择?一代圣魂降临,凭废躯重返巅峰,修五逆破障称神销锋镝者,铸剑为犁,宇内咸安也。有人问顾震“巨霆败慕容霸于淮北,擒陈祺于朝堂,灭荀澈之大景,讨浦健于关陇...破北平南,信义素著,天下云集响应,三徙成都,所图者何?”答曰:“惟愿河清海晏,时和岁丰,人不独亲其亲,不独子其子,为天下人之天下,为大道攸行,永矢弗谖也。”   远古时期,天地不分,一片混沌。上古大神盘古以无上神通开天辟地,自此混沌开;阴阳分,天地运行;万物孕育而生。这万物之中有一元灵,窥天地之玄机;悟众妙之法门,并创玄功于后世。此玄功一分为四,各为:清,灵,空,明四气。正是:清灵天地,空明在世。心是明镜,破天寻踪。一家公子沦落至此,我可以变血腥残暴,也可以跪地求饶,只为做会曾经的自己。你看我笑的如此真实,笑你如此愚蠢,怎么如此轻信他人世界崩坏,风云将起。各方涌动,群雄四起。这个世界怎么了,谁又可终结一切? 每个人心里都住着一个齐天大圣,我们都曾爱憎分明头角峥嵘,向往着自由、热血、激情。是受尽时间洗礼,社会毒打,我们才变得圆滑世故,八面玲珑,变成自己曾经最讨厌的人。当而立之年,我们突然不在平凡,变为超凡者。我们又重新站在了十字路口,是选择继续苟且,还是追寻那曾被遗忘的热血与光。 好吧,其实故事并不复杂,就是一群老男孩们热血上头的故事,活一辈子总得留下点什么,那就一起给年轻人打个样儿! 哥几个走着! 太古如梦的神魔故事,演绎正邪的七大剑派,侠 骨柔情的快意江湖,胜那天上宫阙的九灵宫,最神 秘不过的冰雪国。 漫漫长长的寻凶之路,一剑一酒一宿醉人生无常,大肠包小肠。 孟飞穿越到漫威世界,成为中城高中的一名高中生。 并且绑定签到系统,开局签到终极帝皇铠甲。 在哥伦比亚研究院签到,获得三星奖励,兔符咒。 在复仇者联盟大厦签到,获得四星奖励,镭射眼。 在联合国总部大楼签到,获得五星奖励,暗影军团。 …… 两年后,当灭霸带着他的紫薯兵团入侵地球时。 只见地平线上亮起一道耀眼的光芒……
九尾封天 饮胆少年行 人间华夏史 玄幻:穿成废柴的我,养成了十大女帝 道仙主 危机!开局一台残破机甲 陆地剑仙:剑阁守剑八十年 龙星纪元 高冷大明星是我女友 到异界 流浪狗tk是怎样炼成的 地球升维 掐灭希望 混在皇宫假太监 驯服大师 笔仙之勇往直前 虚实元宇宙 都市无敌大反派 在修仙界活下去 大恶人系统 电视剧人生如戏 电视剧斩女人 韩国悲伤电视剧排行榜 拜托别黑我电视剧2 大猫追爱记电视剧全集剧情介绍 池昌旭跟林允儿演的电视剧 韩国悲伤电视剧排行榜 风雨上海滩电视剧 古村里的女人电视剧 菩提树下电视剧结局是什么 演员陈数主演的电视剧 演员陈数主演的电视剧 天眼电视剧酒店 电视剧斩女人 但是电视剧36集团圆 拜托别黑我电视剧2 最新谍战剧电视剧大全 电视剧人生如戏 一千零一夜电视剧角色 电视剧大哥片尾曲 电视剧斩女人 电视剧大哥片尾曲 一千零一夜电视剧角色 经典电视剧排行 婚姻幽默的电视剧 天眼电视剧酒店 电视剧斩女人 电视剧有2017 电视剧演员雷佳 婚姻幽默的电视剧 一千零一夜电视剧角色 古村里的女人电视剧 啪啪电视剧禁播视频 韩国悲伤电视剧排行榜 菩提树下电视剧结局是什么 暖男记 电视剧全集 啪啪电视剧禁播视频 神之?~电视剧漫画哪个更好 菩提树下电视剧结局是什么 演员陈数主演的电视剧 暖男记 电视剧全集 天眼电视剧酒店 电视剧刑事侦缉档案2 璀璨人生相似电视剧 电视剧人生如戏 古村里的女人电视剧 tvb电视剧背景音乐 暖男记 电视剧全集 电视剧密电风云12 电视剧大哥片尾曲 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 赢万难 玉星传说 不凡魔道 永恒之万界都是我的 以杀登顶 欧博游戏官网 皇冠登3出租 亚星管理平台 欧博游戏官网 亚星管理平台 电视剧刑事侦缉档案2 tvb电视剧背景音乐 啪啪电视剧禁播视频 风雨上海滩电视剧 天眼电视剧酒店 天眼电视剧酒店 电视剧密电风云12 电视剧刑事侦缉档案2 电视剧斩女人 啪啪电视剧禁播视频 地狱少女 电视剧 池昌旭跟林允儿演的电视剧 但是电视剧36集团圆 风雨上海滩电视剧 最新谍战剧电视剧大全 新版水许传电视剧全集 电视剧密电风云12 璀璨人生相似电视剧 风雨上海滩电视剧 婚姻幽默的电视剧 父母爰情完整版电视剧全集 父母爰情完整版电视剧全集 电视剧密电风云12 电视剧密电风云12 电视剧斩女人 婚姻幽默的电视剧 电视剧刑事侦缉档案2 最新谍战剧电视剧大全 大猫追爱记电视剧全集剧情介绍 神之?~电视剧漫画哪个更好