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
医院刷信用卡有影响吗一般信用卡收费医院刷信用卡有影响吗亚马逊日本 信用卡亚马逊信用卡 返现医院刷不了信用卡吗一般交行信用卡额度是多少一直用信用卡网购一个行办多张信用卡吗阳光ic白金信用卡额度阳光ic白金信用卡医院刷信用卡有影响吗一般的农行信用卡额度是多少钱啊扬州交行信用卡一直用信用卡网购阳光ic白金信用卡额度一般交行信用卡额度是多少钱学生信用卡 招商银行学生信用卡 招商银行医院 哪个 信用卡吗一般信用卡的还款日期学生信用卡 招商银行一个行办多张信用卡吗医院 积分 信用卡吗亚马逊信用卡 返现银行贷款要有信用卡亚马逊日本 信用卡医院 积分 信用卡吗医院 哪个 信用卡吗一般的农行信用卡额度是多少钱啊我叫荆少雨,荆轲的荆,年少的少,下雨的雨,出生于南方的一个偏僻的小山村里,故事发生在我十八岁的时候,父母在我出生那年离奇死亡。查理的家族发展史疫情期间,世界领先的AR平台科技公司完美世界的首席技术官吴飞凡被人从他小学同学所开的咖啡厅带走,于此同时,完美世界公司位于临近城市的神经传导实验室老总刘爽也告失踪。 警方经过推理分析发现犯罪人策划这两起事件是为了抢夺完美世界源程序以及该公司正在开发的乐土项目所做出的绑架案件。一句话介绍:小说是章回体体裁,以性格孤僻的刘宏图为视角,讲述了一群九零后的成长故事。 故事梗概:故事前期以友情为出发点,讲述刘宏图在读书时期收获的各个朋友以及发生在他们身上的或荒诞或真实或匪夷所思却又在情理之中的一系列故事。小说中后期则以宏图追逐梦想为主要线索,与朋友们的成长历程交织在一起,同时,整部小说的悲剧色彩已愈来愈重。 分章大纲:1-41章:宏图读书阶段,身边有一群性格鲜明的朋友。42-73章:踌躇徘徊(少年们的迷茫与惆怅)。74-100章:一路坎坷,一路悲歌。是一个充满在神秘色彩中的反正义跨国杀手组织,故事由一起轰动全国的庞大组织杀人案的曝光引发,反正义和正义与之抗衡。一名少年天赋异禀,因被手足残害险些命丧他手,不曾想因祸得福在机缘巧合之下寻得仙界神兵。当绝世神兵再现,引仙魔觊觎之时,他又将迎来一场怎样的命运呢?李易,穿越到大齐王朝,从富商之子,凭借从地球上学来的知识,一步步成为大齐第一异性王爷。周围美女如云,手中权势滔天,家中富可敌国,身边高手如云,部下文臣武将,从此走向人生巅峰,逍遥又自在!这是一个源灵的世界,也是人族凋零的世界,万族镇压,人族前路何在? 王战穿越源灵大陆,成为王家老祖,觉醒源灵召唤系统,老骥伏枥,志在千里,以暮年之身,再为人族血战八方! 万族天骄欺压,人族天骄嬴政、刘彻、李世民等艰难前行,只为护人族百世不衰! 那一日,满头华发的王战自大后方而出,向万族宣告:吾乃人族天骄护道者,谁敢欺我人族天骄?欺我人族? ………… 大儿子王腾:“我人族出了护道者叫王战?跟咱爹同名啊!” 孙子王浩:“爸,不用怀疑,那就是爷爷!我跟他老熟了!” 孙女王若书:“我爷爷超无敌!” 古老的传说,神秘的田家井! 一声巨响,一片残垣断壁,见证了一段血腥的历史。 五百多年后的他从残破古井中进入一处空间裂隙,邂逅元末枭雄陈友谅之女陈飞飞,揭开了一段尘封的历史。他加入华夏国安八局并屡立奇功,战功赫赫的女友为了华夏北斗系统被CIA羞辱,从此他上碧落下黄泉,只为……穿越后的钟文被一个小萝莉捡回了只有女弟子的飘花宫; 这个世界最顶尖的功法、灵技、知识统统来自上古; 于是,研究看不懂的上古文字,成了时代的潮流、身份地位的象征; 偶然的一次机会,翻开一本由上古神文写成的书; 他惊讶地发现......
我带着游戏世界穿越了 偷盗诸天 龙神附体 江蓠映月 地下玄界 mere trash 一个兔子开始的故事 轮回路上 逍遥小秀才 烽火中的家园 名侦探柯南之池总是我哥 黑白通常 念古今 系统大战老爷爷 特异使者 佣兵1929 元宇星空 地球代言人 都市极品天师 凤凰金羽 一般信用卡收费标准 一般信用卡收费多少钱一个月 一般交行信用卡额度是多少钱 学生信用卡 招商银行 一般信用卡收费标准 医院 积分 信用卡 一般信用卡收费多少 一般的农行信用卡额度是多少 银行贷款要有信用卡 一般的农行信用卡额度是多少钱啊 一个行办多张信用卡吗 一般信用卡收费多少合适 医院 哪个 信用卡 一般信用卡收费多少钱一个月 医院刷不了信用卡吗 亚马逊信用卡 返现 一般信用卡收费多少 银行贷款要有信用卡 一般信用卡的还款日期 医院刷信用卡有影响吗 一般信用卡收费多少钱一个月 一直用信用卡网购 一般信用卡收费 扬州交行信用卡 阳光ic白金信用卡额度 医院 哪个 信用卡 银行贷款要有信用卡 一般信用卡收费 一般信用卡的还款日期 银行贷款要有信用卡 亚马逊信用卡 返现 一般信用卡收费多少钱一个月 亚马逊哪个银行信用卡优惠多 医院刷不了信用卡吗 医院 积分 信用卡吗 亚马逊信用卡 返现 亚马逊哪个银行信用卡优惠多 一般交行信用卡额度是多少钱 医院 哪个 信用卡 一直用信用卡网购 亚马逊日本 信用卡 一般的农行信用卡额度是多少钱 医院刷不了信用卡 一般信用卡收费多少合适 扬州交行信用卡 一般信用卡收费多少钱一个月 一般信用卡收费多少合适 亚马逊日本 信用卡 医院 哪个 信用卡 一般交行信用卡额度是多少 亚星官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 荡世九歌 长平长平 封神:吾为人皇,开局创建聊天群 万祖 天下第一卦 葡京官网 欧博官网 亚星管理平台 欧博游戏官网 亚星管理平台 一般信用卡收费多少钱一个月 扬州交行信用卡 一般信用卡办啥样的 阳光ic白金信用卡 一般的农行信用卡额度是多少 一个行办多张信用卡吗 一般的农行信用卡额度是多少钱 医院刷信用卡有影响吗 一般的农行信用卡额度是多少时间 医院刷信用卡有影响吗 医院 积分 信用卡 一直用信用卡网购 一般交行信用卡额度是多少钱 亚马逊信用卡 返现 一般信用卡收费多少 医院 积分 信用卡 一个行办多张信用卡吗 一般信用卡收费多少 医院刷信用卡有影响吗 一般信用卡收费多少合适 一个行办多张信用卡吗 医院 哪个 信用卡 一般信用卡办啥样的 一般信用卡收费多少 一般信用卡收费 一般信用卡收费多少钱一个月 亚马逊哪个银行信用卡优惠多 阳光ic白金信用卡额度 银行贷款要有信用卡 一般信用卡的还款日期