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
乐天信用卡支付失败怎么取消信用卡支付绑定交通银行信用卡积分支付失败亚马逊上信用卡支付什么是信用卡无卡支付乐天信用卡支付失败信用卡付款后套用积分交通银行信用卡积分支付失败付款的时候信用卡有单比上限工行信用卡500提手机和信用卡丢了乐天信用卡支付失败信用卡支付机票要所有资料安全吗手机和信用卡丢了交通银行信用卡积分支付失败工行信用卡500提亚马逊信用卡怎么申请什么是信用卡无卡支付什么是信用卡无卡支付交通信用卡支付限额visa信用卡?~度淘宝网信用卡可以支付吗付款的时候信用卡有单比上限手机上怎样找信用卡支付的淘宝店信用卡无卡支付安全吗手机淘宝信用卡手续费亚马逊上信用卡支付浦发信用卡怎样提额交通信用卡支付限额国外信用卡刷卡手续费他穿越了,拥有着把异界生物变成一个猛男的能力,从此过上了没羞没躁~啊不~是开始了征服世界的旅程第一次写,如果质量差的话可以提意见,不喜勿喷,谢谢大家ovo命运长河的波澜一往无前 受到命运之神的眷顾 万石成为这一代的机械主神 带领机械文明走向复兴元宇宙经典游戏出马传奇,沈庸一人独开四号,各有所长 另有三位妹妹辅助,四人共同纵横驰骋,称霸游戏!意外穿越异世,别人成仙成佛,惨点的也是废物逆袭。 可是到了古二蛋这里,他却发现自己一点盼头也没有。 因为这家伙成为了一个骷髅兵!还是一个没有脑袋的下等残躯战损版骷髅兵! 生活不易,骷髅叹气,望着自己一两肉都没有的身体,古二蛋决定要逆袭给所有人看! “金手指系统!我要称王称霸!给我发威!” “收到宿主期盼,本系统已按照期盼进行修改,正式进化为骷髅领主系统,你可以通过收集资源来强化麾下士兵啦!而且是没有上限的强化呦!” “哦?这么厉害的吗!那么这种能力也能作用到我的身上对吧!” “…………” “对吧?” “…………” “对吧?!!!”一个死而另类复生的人,在人类的世界就已经不再属于参与者了,整个世界对于这个人而言只是一场长途的履行罢了。 【轻松诙谐向+假太监+女扮男装的皇帝+假太后+种田+权谋天下】   孙羽意外穿越到了大秦宫内一个小太监身上,同时觉醒了超级大太监系统。   哄骗过净身师傅,孙羽带着茶壶嘴进了皇帝御书房当差,本来还打算找机会开溜的他,突然发现那个眉清目秀的皇帝,竟然是女儿身……   还有那个在内宫作威作福的太后,竟然也是假的?   看着系统给出的任务,孙羽犯起了难,他该兼收并蓄,还是该雨露均沾?    既然手持系统,自然要一步步向上,一步步站到最高,做最高的…太监太上皇? 塑圣魂,觅长生,热血前行,登仙道!他,是世界顶级组织kh的核心精英级特工,原本拥有优质的一切,然而有天,他厌倦了一成不变的生活,虽然条件优越,可必定受制于人,于是他决定,摒弃目前所拥有的一切,重新开始,重新书写他璀璨的一生(都市+系统+搞笑+腹黑) 摩天轮上无数情侣正在恩爱。 张北哼着小曲,按下了红色的按钮。 身处于百米高空的摩天轮突然停住。 随后竟然横了过来。 无数坐在椅子上的情侣被弹射到了半空,仅有一个绳子连接。 几秒种后,整个摩天轮就像一个飞速旋转的盘子。 无数情侣在半空中玩起了温馨和谐的游戏。 跳楼机上,九十米高空的人体悠悠球。 碰碰车上,充满僵尸鬼怪的地下逃亡。 医生看着刚刚从过山车上下来的游客,将一颗速效救心丸塞进了壮汉的嘴中。 眼神中充满了幽怨。 “老板,这么下去会死人的!” “不会,你看他们多开心!”
九州战魂 神迹之超能战警 往生诸天记 地球坠落 天矶 六子传奇 进化最强宠物 考古野史 大唐,开局李二是我爹? 桃源小神农 三界焚尊 我家婢女有点凶 网王之世界之巅 最强系统之我是主角 游戏系统从传奇开始 传送阵法 我带着面板在诸天轮回 混沌五行,因果轮回 大镇师 大明:人在洪武,朝九晚五 后室 怎么取消信用卡支付绑定 工行信用卡500提 亚马逊信用卡怎么申请 什么是信用卡无卡支付 怎么取消信用卡支付绑定 为什么淘宝信用卡无法合并付款 淘宝店铺申请信用卡支付 信用卡支付服务费 为什么淘宝信用卡无法合并付款 信用卡支付机票要所有资料安全吗 蚂蚁花呗算信用卡吗 蚂蚁花呗算信用卡吗 手机上怎样找信用卡支付的淘宝店 工行信用卡500提 乐天信用卡支付失败 信用卡无卡支付安全吗 阿里巴巴支持信用卡付款吗 手机淘宝信用卡手续费 建设银行信用卡取钱手续费多少 乐天信用卡支付失败 信用卡网银支付 0手续费 交通银行信用卡积分支付失败 建设银行信用卡取钱手续费多少 淘宝网信用卡可以支付吗 信用卡支付服务费 淘宝怎么看商家可以用信用卡 手机淘宝信用卡手续费 建设银行信用卡取钱手续费多少 visa信用卡?~度 手机淘宝信用卡手续费 什么是信用卡无卡支付 信用卡网银支付 0手续费 亚马逊上信用卡支付 乐天信用卡支付失败 手机上怎样找信用卡支付的淘宝店 信用卡无卡支付安全吗 淘宝使用信用卡购物手续费 淘宝店铺申请信用卡支付 手机上怎样找信用卡支付的淘宝店 淘宝使用信用卡购物手续费 信用卡无卡支付安全吗 交通银行信用卡下款查询 交通信用卡支付限额 阿里巴巴支持信用卡付款吗 手机和信用卡丢了 信用卡网银支付 0手续费 蚂蚁花呗算信用卡吗 信用卡无卡支付安全吗 淘宝怎么看商家可以用信用卡 信用卡付款后套用积分 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 我重生为汉献帝了! 落入被平分的世界 我只想平平淡淡过生活 老虎和美女有趣的玩乐 从灵气复苏开始变强 亚星游戏官网 万利官网 欧博游戏官网 亚星游戏官网 葡京官网 什么是信用卡无卡支付 信用卡网银支付 0手续费 国外信用卡刷卡手续费 手机淘宝信用卡手续费 广发信用卡如何开通大额支付 付款的时候信用卡有单比上限 浦发信用卡怎样提额 淘宝店铺申请信用卡支付 交通银行信用卡积分支付失败 怎么取消信用卡支付绑定 信用卡网银支付 0手续费 信用卡网银支付 0手续费 亚马逊上信用卡支付 信用卡无卡支付安全吗 广发信用卡如何开通大额支付 乐天信用卡支付失败 淘宝怎么看商家可以用信用卡 手机和信用卡丢了 信用卡支付机票要所有资料安全吗 手机淘宝信用卡手续费 交通信用卡支付限额 信用卡支付服务费 浦发信用卡怎样提额 亚马逊信用卡怎么申请 乐天信用卡支付失败 建设银行信用卡取钱手续费多少 手机和信用卡丢了 手机和信用卡丢了 为什么淘宝信用卡无法合并付款 浦发信用卡怎样提额