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
220v/12kw空开价格carryme自行车折叠价格风行14寸折叠车价格阿兹慕64价格24j 价格220v/12kw空开价格碗莲的价格风行14寸折叠车价格370氧气泵价格泛基亚灯光价格中国梦追梦酒的价格220v/12kw空开价格赣州批发蔬菜价格中国梦追梦酒的价格风行14寸折叠车价格泛基亚灯光价格兰州鲤鱼批发价格24j 价格24j 价格zoom避震前叉价格御明智能炒菜机价格泛基亚 价格370氧气泵价格捷安特折叠自行车价格表环宇dw15一1600价格癞葡萄的市场价格阿兹慕64价格速立达折叠自行车价格及图片zoom避震前叉价格深圳肉菜价格天地九州,邪祟的入侵,生灵涂炭;天魔的布局,人仙崩溃。 在蓝星的方尘被某种力量来到了这个世界,本以为是历史古代,却亲眼看见一名修士一剑千里之外,方尘的心不安跳动。 邪祟?食物罢了。 天魔?口味不错。 人族大圣(魔圣)降临,人族崛起!这是一本同人小说,续写的萧潜发在17K小说网的玄幻作品《秒杀》。本书从2014年11月29日开始创作,在创作前已经征得他本人的同意。 《秒杀》的质量上乘,故事情节虽不泛前后矛盾之处,但是创意新颖,脑洞很大。唯一的遗憾就是结尾收的太仓促,看得人如梗在喉,非常难受,考虑再三后,我决定自己写一本秒杀续。     考虑到现在的读者,恐怕已经没有多少人看过《秒杀》了,所以我对开头部分做了一定的修改,尽量弱化本书对《秒杀》的依赖,实在绕不开的地方,就以回忆杀的方式简单交代几句。   所以现在这本书,是一本全新的小说。出于对萧大大尊重,简介就算是对他的作品的宣传,但是你不必专门去看《秒杀》,也一样能看本书,不会出现情节衔接不上的情况,因为即使是我,也已经忘记了《秒杀》里面的情节。   魔主?我的乖乖,想不到本公子竟然会是最大的反派 宋江:那是我的梁山? 萧禾:梁山?星主的?谁说的,靠边靠边,我先来的 宋江:可是,九天玄女给我说的 宋徽宗:吾的九鼎何在 道长:在梁山喜看网文事业成功的男主,意外落崖之后穿越到自己熟读十余遍的小说世界中,而男主雷震凭借着前世的能力和对异世界的熟悉,重整异世、道心屠魔 破界寻妻! 男主做事果决,飒爽干练,故事逻辑严谨清晰,可以细品。讲故事,很用心,跟我来,不后悔…… 一次意外,世界顶级雇佣兵穿越到异世界,成为了银龙城附近的猎人。 十几年过去,他一直以为自己穿越而来只会成为一个闲散的猎人,每天只会钓钓鱼,抓几只兔子,摘几株药材换酒钱打发时间,最大的乐趣不过是调戏邻居的小女孩。 但在他十五岁的凛冬日,村子里最强大的猎人大胡子离奇失踪,无奈之下,庭瑞只得踏入到苍茫山脉寻找大胡子的踪迹。 越过茫茫群山,踏过无数冰雪,他终于找到了大胡子在坚冰上刻下的痕迹。 但令人费解的是,上边只留下了一个潦草的“鬼”字便再无其他痕迹。 就在林庭瑞感到疑惑沉下心思思考的时候,他的身后突然响起了喀嚓喀嚓的踩雪声…… 历史上的唐朝,一个经历了繁荣与没落的王朝,大起大落中江湖里围绕着洛阳城里林府的三位姑娘又发生了哪些快意恩仇的事件让人感慨人生。我一直认为,人是有灵魂的动物。活着的时候,灵魂附于肉体,死了之后,肉体归于尘土,灵魂则脱离肉体的束缚,回归到他该去的地方。 一代仙界丹师意外附身在一个豪门纨绔身上,成为一个插班生,以一身神奇仙术,混迹于美女丛中,在都市独领风骚! 每天三更,微信关注每满100加更一章!读者一群:233514189(已满) 读者二群:894706463 微信公众号:如墨似血他们因意外穿越到DC宇宙的哥谭市,妹妹王丽会一些基本的空手道和厨艺,哥哥李宇在这里想得到小时候的体验冒险感。林田获得随身空间种田,春花秋月,悠然南山,坐吃山不空。 他只想过好自己的小日子,实力却不允许他低调。 什么是钱?什么是美女?呵。 当灵果风靡全世界,人人求之不得之时,灵果制造商躺在摇椅上悠然撸猫,岁月静好。 然而,当危机降临到他在乎的人身上,要战,便战!
西游之开局拒绝大闹天宫 长生记:轮回之界 假装破产后,老婆跟别人跑了 黑源魔藉 他和他的剑 我成为西泽尔了 绝影刺客 永恒浩瀚 尘与钢 两个欢喜冤家 远离帝宙 王二浪的幸福生活 绝!颜 潇漓传 大魏说书人 光阴旅人 入赘后,娘子对我太好怎么 千门八将 最是寂寞逍遥仙 高武:开局卖锅碗瓢盆 carryme自行车折叠价格 泛基亚灯光价格 兰州鲤鱼批发价格 24j 价格 carryme自行车折叠价格 野生红水果种苗价格 2016三星s6港版价格 化肥碳酸氢铵最新价格 野生红水果种苗价格 赣州批发蔬菜价格 如新spa仪器价格 如新spa仪器价格 捷安特折叠自行车价格表 泛基亚灯光价格 220v/12kw空开价格 环宇dw15一1600价格 seiko100m 530322手表价格 癞葡萄的市场价格 三只松鼠 产品价格 风行14寸折叠车价格 巴基斯坦铜花瓶价格是多少 风行14寸折叠车价格 三只松鼠 产品价格 泛基亚 价格 泛基亚价格 中天房车c型旅居房车价格 癞葡萄的市场价格 三只松鼠 产品价格 御明智能炒菜机价格 癞葡萄的市场价格 24j 价格 巴基斯坦铜花瓶价格是多少 阿兹慕64价格 220v/12kw空开价格 捷安特折叠自行车价格表 环宇dw15一1600价格 阿兹慕64价格 2016三星s6港版价格 捷安特折叠自行车价格表 铜花洒价格 环宇dw15一1600价格 化肥碳酸氢铵最新价格 zoom避震前叉价格 seiko100m 530322手表价格 中国梦追梦酒的价格 巴基斯坦铜花瓶价格是多少 如新spa仪器价格 环宇dw15一1600价格 中天房车c型旅居房车价格 碗莲的价格 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 末世荡漾 断之界 青阳斩神录 都市:仙道重修 无上霸体金身诀 亚星游戏官网 万利游戏官网 万利官网 亚星游戏官网 葡京官网 泛基亚价格 化肥碳酸氢铵最新价格 兰州鲤鱼批发价格 如新spa仪器价格 癞葡萄的市场价格 阿兹慕64价格 泛基亚灯光价格 德力西100a空开价格 24j 价格 捷安特折叠自行车价格表 化肥碳酸氢铵最新价格 铜花洒价格 环宇dw15一1600价格 环宇dw15一1600价格 德力西100a空开价格 德力西100a空开价格 速立达折叠自行车价格及图片 捷安特折叠自行车价格表 癞葡萄的市场价格 阿兹慕64价格 巴基斯坦铜花瓶价格是多少 370氧气泵价格 野生红水果种苗价格 泛基亚 价格 三只松鼠 产品价格 化肥碳酸氢铵最新价格 捷安特折叠自行车价格表 seiko100m 530322手表价格 阿兹慕64价格 阿兹慕64价格