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
信用卡难办理吗信用卡能转账存定期么信用卡能不能白条还款信用卡能改成别人的吗信用卡能改手机号码吗信用卡难办理吗信用卡能刷车吗信用卡能不能白条还款信用卡能网络套现吗信用卡能使用多久能恢复吗信用卡能跨行扣款吗信用卡能不能白条还款信用卡能使用多久时间信用卡能跨行扣款吗信用卡能不能白条还款时间信用卡能使用多久能恢复吗信用卡能提到多钱呀信用卡能结汇购汇不信用卡能改手机号码吗信用卡那个行好信用卡能用网银转账吗信用卡能结汇购汇不信用卡能网络套现吗信用卡民生兴业信用卡能改户名吗?信用卡民生光大兴业信用卡能改户名吗?信用卡民生华夏信用卡那个行好信用卡能使用多久时间限制吗夏魄爆肝一款修仙游戏十五年,通关之时却意外来到游戏的世界,成为了一个家族的杂役。 还好这游戏把通关奖励送给了他,让他得到了长生不死的能力。 在这里付出了十五年青春的他深知这个人心叵测,妖魔横行的世界很危险,于是决定苟起来修炼个几千年再说。 时光流逝的飞快,在熬死了无数强敌之后,他发现自己已经无敌了。西部无人区的追捕者简介无力,请看正文 一小伙一夜之间成为武者,多年寻求突破的气功大师终于突破,与一个建议勇为的年轻人息息相关...... 叶休在英雄救美的时候被推下车撞在了石头上,获得了创造宝石,这一刻,世界为他变得精彩【恐怖】【玄幻】【灵异】【搞笑】老式港产恐怖片画风的悬疑小说。 当什么社畜,不如辞职去当玄术大师。手执八卦镜,身背桃木剑,一身庄严肃穆的道袍;举手投足之间无一不显现出自己是个万民敬仰,救人于水火的大英雄。不过选择了这条路,难免会与鬼怪打交道。所以...你准备好了吗?历史教师李正穿越到了唐朝贞观年间,并觉醒了网上商城系统,在大唐,他通过低买高卖,开启当奸商的头脑。 啥,9块9包邮的玻璃杯也能卖出天价?一颗玻璃珠也能换一斤黄金? 李正却表示:这都是小意思。 东搞西搞,弄出了火药、玻璃、香水等物,赚到了无数的钱财,让李世民和其他大臣都赞叹此子是个生意奇才。 吐谷浑犯境?老子用火药把你灭了!小倭寇犯贱?老子用传销让你民不聊生!武媚娘太漂亮?老子用美色把你泡了! 天下的财富,全都向李正涌来,老子是天下第一奸商!高考又一次失败,却意外进入了神秘学院。从此踏入了宿命早已注定的道途。 犯我中华者,虽远必诛! 有我在!尔等休想猖狂!落魄皇子,龙游浅水,偶得机缘,困龙升天! 本作品讲的是一个不知名的小人物一步一步成为仙界至尊武道巅峰的故事是人间美好?还是阴曹地府美好?这个问题很难回答!但是在人间混,撑死威风五十年,而在阴曹地府混,则可威武千百世。那么问题来了,为什么还有那么多魂魄,想尽各种办法讨好判官阎王,迫不及待的要回到人间转世呢?搞不懂!也没人搞得清楚!萧石竹便是搞不懂这个些问题的其中一鬼,但是他现在没有时间去搞懂这个问题了,怎么在地府里生存下去,在投胎之前做个鬼上鬼,才是他的首要任务。交流群:108030161在那一天公司聚会陆游喝醉了,一觉醒来看着尸骨遍野的周围以为到了乱葬岗却不成想那是张角的黄巾起义。 至此他默默的加入了十八诸侯,看见了三英战吕布、见证了火烧赤壁败走华荣、也逢上了秋风五丈原、三家归晋。
复定天地 回首这二十年 我被它们选中 月菲深悲 西游我竟然变成了挖掘机 掌中之剑 全能系统之玄天 轮回之孽,九世之缘 一只鬼眼里的世界 修仙:我的系统有点坑 妖道傲天 神豪:我呼吸就赚钱 镜像界 我的双眼看见鬼 最贼修仙者联盟 我在用社死拯救世界 大明败家子 大荒祖龙诀 钟表外的平凡人生 元宇宙:眼镜开启无限世界 信用卡能自动挂失吗 信用卡能使用多久能恢复 信用卡能提到多钱呀 信用卡能改手机号码吗 信用卡能转账存定期么 信用卡民生华夏 信用卡能提到多钱呀 信用卡能使用多久能恢复正常 信用卡民生光大兴业 信用卡能使用多久时间 信用卡能提现到支付宝安全吗 信用卡能提现到支付宝安全吗 信用卡哪里写账单日 信用卡能使用多久能恢复 信用卡难办理吗 信用卡能改手机号码吗 信用卡能提现到支付宝 信用卡能自动挂失吗 信用卡能支付哪些商家 信用卡能不能白条还款 信用卡能使用多久能恢复 信用卡能不能白条还款 信用卡能支付哪些商家 信用卡能结汇购汇不 信用卡能使用多久能恢复吗 信用卡哪里写账单日 信用卡能自动挂失吗 信用卡能支付哪些商家 信用卡能支付哪些商家 信用卡民生光大兴业 信用卡能改手机号码吗 信用卡能使用多久 信用卡能改成别人的吗 信用卡难办理吗 信用卡民生兴业 信用卡能改户名吗? 信用卡能改成别人的吗 信用卡能提到多钱呀 信用卡民生兴业 信用卡能不能白条还款时间 信用卡能改户名吗? 信用卡能使用多久能恢复正常 信用卡那个行好 信用卡能提现到支付宝 信用卡能跨行扣款吗 信用卡能使用多久 信用卡能提现到支付宝安全吗 信用卡能改户名吗? 信用卡哪里写账单日 信用卡能刷卡买车吗? 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 灵境圣者 终末序列 血战匈奴 我们都在同一世间享受 江湖豪侠传 欧博游戏官网 百家乐官网 亚星管理平台 欧博官网 亚星管理平台 信用卡民生华夏 信用卡能改户名吗? 信用卡能跨行扣款吗 信用卡能结汇购汇不 信用卡那个行好 信用卡能提到多钱呀 信用卡能用网银转账吗 信用卡能跨行扣款吗 信用卡难办理吗 信用卡那个行好 信用卡能使用多久时间 信用卡难办理吗 信用卡能改成别人的吗 信用卡能使用多久能恢复正常 信用卡能改成别人的吗 信用卡能自动挂失吗 信用卡能结汇购汇不 信用卡能刷卡买车吗? 信用卡能提现到支付宝 信用卡能提到多钱呀 信用卡能使用多久 信用卡哪里写账单日 信用卡能使用多久能恢复 信用卡能提现到支付宝 信用卡能使用多久能恢复正常 信用卡能使用多久能恢复 信用卡能转账存定期么 信用卡能使用多久能恢复吗 信用卡能使用多久时间限制吗 信用卡能支付哪些商家