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
广东通信论文书房设计论文通信业务员论文文化创意产业发展论文宁波大学硕士毕业论文模板广东通信论文影视动画欣赏论文通信业务员论文卫星电视论文测绘专业论文题目自主学习论文广东通信论文论文题目 英语自主学习论文通信业务员论文福建自考论文良郑绵平 论文宁波大学硕士毕业论文模板宁波大学硕士毕业论文模板建筑材料试验论文初中科学论文主题关于农村经济的论文卫星电视论文特殊教育德育论文论文格式作者写蝙蝠的论文文化创意产业发展论文北京工商大学会计学本科论文任务书依据建筑材料试验论文六书造字法有关论文十三年前余浩全家被神秘男子杀害,将妹妹转化为尸鬼。 十三年后余浩成为一名天命师,开始踏上复仇之路,揭开一场天命师与尸鬼之间长达几千年的恩怨。神魔乱,星落觉。在神奇的网游虚拟世界中,讲述着一位落寞青年,一往无前,披荆斩棘的逆世崛起之旅。从默默无闻,到名震万古,在恶与善,得与失之间,他会如何抉择。界岩,作为一座都城的王,从来没想到自己会成为游离三界的守护神,见证人世间的生离死别,或蔚籍逝者,安息灵魂;或覆手家国灭亡,只为人世间最大的安宁。 南陌城是个三线的小城市没什么特别吸引的或许是这样张清之在这里开了一家饮料店,店里有一条很奇怪的规矩便是不准带走,但也因为古怪留住一批古怪的顾客,也因此引出大家的故事……一段未知星球讯号的发现,彻底改变了苏飞的命运,二十五岁的苏飞被带回八年之前,面对重复的人生,苏飞赫然发现自己的体内竟然存在一个外星智能生物……这一次,他不再平凡! 有幸穿越了,还是生在地主家,此生不缺吃穿却也不想混吃等死,所以傅小官随意的做了些事情,没料到产生的影响如此巨大。 皇帝要让他官居一品,公主要招他为驸马,尚书府的千金非他不嫁,荒人要他的头,夷国要他的命,樊国要他的钱…… 可是,傅小官就想当个大地主啊!原本吴向东作为医院高新人才引进计划的成员而备受瞩目,却因为一场突如其来的医疗事故坠入深渊,不但被医院打上“推诿病号”的烙印,更是在同窗的推波助澜下被医院发配到乡下干起了赤脚医生,耽误了前程。 虽然多年后他凭借精湛的技术在医疗行业中闯出属于自己的一片天地,却始终因为那件事被人诟病,无法将自己的健康理念推向全国,而后在某次醉酒中他发现自己重新回到1999年的那场医疗事故的当晚。 于是那个男人回来了,他凭借前世经验,在那个单纯以治疗疾病为目标的年代,始终坚持以病人本身为治疗原则,在他的带领下,医疗行业发生翻天覆地的变化,而他和自己的团队也在一次次医疗事件中,逐步登上世界医学的舞台并伫立在世界之巅。简介:生物博士萧剑波投身艰苦卓绝的抗日战争中,和日、伪、敌、特斗智斗勇,心思缜密、机智灵活。 从华北平原到巴山蜀水、关中盆地,周旋于错综复杂的环境中,谱写了保家卫国的英雄传奇。李问天从来没有想过,自己会以这样的方式离开拼命守护和努力战斗的家族,面对昔日的好友,族人,还有爱人,竟没有一人站出来,哪怕说上一句好话,冷眼旁观,奚落讥讽。 这一切我李问天记住了,风水轮流转,今日之辱他日必定数倍奉还! 赵全,应用化学及治金双料硕士,毕业后学无所用,无房无车无女友,穿越后遂为赵瑔,江西铅山赵家庄里正之子,时逢南宋末年,宋廷上下偏安一隅苟且偷安,赵瑔以所学创业,引领宋人时尚风标,一步跨入富豪行列,计划趁大宋终结前乘船下南洋占个地方做“南阳村长”赵家庄之福引来盗匪垂涎,赵瑔不得不自建民团以自保,前世宅男从无逐鹿天下的雄霸之心,以“草根”为荣,但世事难料,为获取心仪女孩青睐,赵瑔剽窃伟人诗词以“才子”之名不胫而走,高薪聘请工匠得“奢遮小官人”褒誉。锲而不舍想泡美艳无双的白莲教天母,率民团连破白莲教数城。白富美愿以身相许,赵瑔大手笔招揽安置流民,大举开拓宝岛台湾。葛皂山灵宝天尊到场“以客座首席长老”礼待,朝廷封赐忠武节度使”,当赵瑔一步步被罩上光芒四射的主角光环时该何去何从?率领武装到牙齿的龙神军暴们下南洋占地当村长?指挥天下无二的强大帆舰称霸四海殖民东西半球?还是挥师北上笑看火枪对决弓马?
放牛之世 仙帝归来之最强奶爸 全民领主:我是财神大人 点燃神火从游戏开始 禁地 绿茵江湖 我以蝼蚁之身闯异界 我复活在神魔战场 神豪:我呼吸就赚钱 逃不出黑暗 凌霄酒仙在人间 栅栏上的夕阳 白与昼,黑与夜 :忆 修仙:家族崛起 名剑英雄传 源能重生 半吊子闯红尘 釜山站之行 高三回忆录 写蝙蝠的论文 福建自考论文良 郑绵平 论文 宁波大学硕士毕业论文模板 书房设计论文 北京工商大学会计学本科论文任务书依据 与家长沟通论文 如何保障和改善民生论文 大学生与父母沟通论文 论文题目 英语 科技论文的题目 科技论文的题目 特殊教育德育论文 福建自考论文良 广东通信论文 论文格式作者 压风机的检修论文 写蝙蝠的论文 广告公司人力资源管理论文 通信业务员论文 郑绵平 论文多发 通信业务员论文 广告公司人力资源管理论文 关于农村经济的论文 测绘专业论文题目 延迟退休年龄 论文 写蝙蝠的论文 广告公司人力资源管理论文 初中科学论文主题 写蝙蝠的论文 宁波大学硕士毕业论文模板 郑绵平 论文多发 文化创意产业发展论文 广东通信论文 特殊教育德育论文 论文格式作者 文化创意产业发展论文 与家长沟通论文 特殊教育德育论文 对周易的理解论文 论文格式作者 如何保障和改善民生论文 建筑材料试验论文 压风机的检修论文 自主学习论文 郑绵平 论文多发 科技论文的题目 论文格式作者 延迟退休年龄 论文 郑绵平 论文 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 乱世争雄之荆楚 元宇宙:精神末世大逃杀 居然有个高手 文明继承者 我在末世订外卖 亚星游戏官网 万利官网 欧博游戏官网 亚星游戏官网 葡京官网 如何保障和改善民生论文 科技论文的题目 郑绵平 论文多发 写蝙蝠的论文 郑绵平 论文 福建自考论文良 通信业务员论文 北京工商大学会计学本科论文任务书依据 特殊教育德育论文 广告公司人力资源管理论文 写蝙蝠的论文 卫星电视论文 中学生课外阅读论文 实践 论文格式作者 郑绵平 论文 广告公司人力资源管理论文 如何保障和改善民生论文 压风机的检修论文 自主学习论文 写蝙蝠的论文 影视动画欣赏论文 广东通信论文 广东通信论文 压风机的检修论文 压风机的检修论文 六书造字法有关论文 书房设计论文 科技论文的题目 建筑材料试验论文 文化创意产业发展论文