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
北梦只是烟花一场 自我嘲笑 小说有声小说 美娜4小说 斗破苍穹2青春离婚 小说龙氏家族系列小说 韩降雪中学生 小说孽乱山沟 小说小说 斗破苍穹2重生亚当 贾羽 小说请回答二零一四 回锅豆腐 小说雨后小故事 小说版北梦只是烟花一场 自我嘲笑 小说战俘小说望君心小说小说 斗破苍穹2请回答二零一四 回锅豆腐 小说走过冬天 火焰 小说嫣然大家 小说嫣然大家 小说捡个神仙做儿子 迷路的哑巴 小说十月十二 小说嫣然大家 小说重生亚当 贾羽 小说待寝将军 艾可 小说龙氏家族系列小说 韩降雪小说驭神青春离婚 小说待寝将军 艾可 小说新公司 沙滩 排球 游泳池 小说战俘小说 “叮,你的体质嫌你修为太弱,主动帮你修炼,恭喜你突破了!” “叮,你的体质嫌你天赋平平无奇,帮你升级到万古无一的仙品天赋!” “叮,你的体质觉得你眼神不好使,帮你开启绝世神通,六道仙轮眼!” “叮,你的体质很暴躁,嫌你修为还是太弱,一言不合就截取世界本源助你修行,恭喜你又突破了!” 叶青穿越异界,觉醒万古最强妖孽体质,躺着就能变强,一路无敌横扫,威临诸天万界,镇压无数天骄! 仙庭圣女:“天呐,世间为何会有如此妖孽?这还让不让人活了!” 人族圣子:“自从我认识叶青,才知道什么叫天骄!都别拦着我,以后叶青就是我老大了!” 魔族魔女:“叶青这家伙,为何如此优秀?” 叶青:“其实我真的没有开挂啊!体质,咱求你低调一点行不行?”一个出身贫寒的人 ,进入警局有多大的用处梦?真实?又有谁能分得清述说异世大陆,种族纷争,魔物横行,皇子身份,天资受阻,离乡背井,开启新的人生,主角冥皇:“世间没有逆天,我来创造逆天!” 亲爱的读者朋友,请静心阅读我的小说,用鲜花和收藏支持我吧!故事发生于2010年某个夜黑风高的停电夜,在一处“荒废”老宅里发生的一系列事情。男主一家三口在连续经历了偷窃、双亲亡故、惊魂托梦、祖产纠纷、假遗嘱、跟踪等一系列变故,最终不堪其扰搬离老宅。那些为了钱财可以抛弃手足情长的坏家伙,能轻易放过他们一家三口吗?2155年,大战之后的一百多年,地球上一片疮痍,人们依旧生活在物资匮乏的世界之中,此时,由地球联合政府授意,一款由中文meta公司开发的元宇宙游戏《天下》即将上线,这是一款号称人类“第二世界”的游戏,在这款游戏里你可以获得一切,金钱、物资、武器、地位,应有尽有。 少年林昭,一个意外成为植物人的贫民区机车少年,偶尔获得了游戏里的一个内测机会,是否能改变命运,重启新的人生? …… 这款《天下》游戏的故事背景空前强大,融合了各大爆款IP,《修罗武神》《万古第一神》《九星霸体诀》《超级兵王》……你可以在中文IP宇宙里体验各种奇异的世界,不同的人生! 本书又名《剑仙元宇宙》!非小白爽文。在一个不知道时空坐标的宋朝,吴用只是个“无用”的青年。他是个矛盾体,一边自强不息,坚信“天生我材必有用”。一边在不公平的环境中悲观。他其实只是个普通人,有欢乐,有悲哀。有随遇而安的颓废,也有遥不可及的宏伟理想。可他没想到的是,经历了多种奇遇,在山海游乐园突破瓶颈之后,他竟然用传说中的文化,引导了现代科技。最终带领人类突破科技的瓶颈。他让文化插上了科技的翅膀,让神话站在了科学的肩膀上。将心比心。换位思考。反躬自问。已所不欲,勿施于人。 不知从何时起,这样的词汇就时不时地出现在生活中,但每每适用于我自身时,换位换心的我总是向着我。 不管我怎么把我翻过来调过去,我还是向着我。 不记得有多少回,我把《我和向着我的我》的故事讲给人听,总是能听到,我也一样。 如何能变成一个聪明的人?如何能变成一个富有的人?这恐怕是每个人都反复思考过的问题。如何不变成一个愚蠢的人?如何能不变成一个穷人?相信很少有人这样设问。如何变成一个愚蠢的人?如何能变成一个穷人?谁会这么想,脑子进水了。不,这才是智者面向普世的叩问。 因为我问了,转着圈地问了。我还是向着我了。 找到脱离我的我怎么就这么难!于是,2018年向着我的我出发了,去寻找脱离我的我。 秦凡为救老婆,不得已暴露自身能看到宝物气息的能力,不断捡漏,只要是宝物,在秦凡的眼中都无所遁形,因此引起各方势力的注意,破真伪,看人心,鉴宝捡漏,玩转人生…… 夜羽穿越花果山灵明碎石上乌鸦巢穴乌鸦蛋,得孙悟空爆破出世时散于天地,徘徊乱石周围的造化,从此开始踏入妖修之路!
下次一定可以 古村遗梦 穿越之我在南宋那些事儿 都市之最强武帝修真者 百年争战 无双重创 也就那点事儿了 终末的生存实录 妖道傲天 重生:我在玄幻造加特林 东北风云二十年:兴安岭秘闻 综漫:我是穿越者的噩梦 我笑修炼是坐牢 老婆重生后,我成了世界首富 踏武入圣 道无心 深海之夜 巫门相医 梦魇时录 大唐神级奶爸 刀棠 小说 青春离婚 小说 五蠢 小说 中学生 小说 活死人 加油站小说 岚风 是那部小说的人物 五蠢 小说 嫣然大家 小说 重生亚当 贾羽 小说 望君心小说 战俘小说 战俘小说 十月十二 小说 青春离婚 小说 完结玄幻小说下载 txt 电子书 免费下载全本 捡个神仙做儿子 迷路的哑巴 小说 海贼王之我的玛亚 猫知鱼之乐 小说 刀棠 小说 走过冬天 火焰 小说 待寝将军 艾可 小说 杨川宁权林风的小说是哪本 待寝将军 艾可 小说 走过冬天 火焰 小说 北梦只是烟花一场 自我嘲笑 小说 龙氏家族系列小说 韩降雪 有声小说 美娜4 小说驭神 有声小说 美娜4 十月十二 小说 小说驭神 龙氏家族系列小说 韩降雪 谜局 官场小说 杨川宁权林风的小说是哪本 北梦只是烟花一场 自我嘲笑 小说 待寝将军 艾可 小说 龙氏家族系列小说 韩降雪 杨川宁权林风的小说是哪本 走过冬天 火焰 小说 恶毒女配翻身记 千千小说 小说 斗破苍穹2 青春离婚 小说 海贼王之我的玛亚 猫知鱼之乐 小说 捡个神仙做儿子 迷路的哑巴 小说 刀棠 小说 望君心小说 谜局 官场小说 刀棠 小说 青春离婚 小说 新公司 沙滩 排球 游泳池 小说 孽乱山沟 小说 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 末日桃花生存系统 降临自己创造的世界 讨孙平叛传 来这世界走一遭 反派能有什么怀心思 澳门葡京官网 快连下载 欧博官网 澳门葡京官网 欧博官网 无上真魔 忘情至尊 小说 待寝将军 艾可 小说 杨川宁权林风的小说是哪本 待寝将军 艾可 小说 小说驭神 新公司 沙滩 排球 游泳池 小说 孽乱山沟 小说 刀棠 小说 活死人 加油站小说 北梦只是烟花一场 自我嘲笑 小说 恶毒女配翻身记 千千小说 北梦只是烟花一场 自我嘲笑 小说 请回答二零一四 回锅豆腐 小说 五蠢 小说 小说 斗破苍穹2 无上真魔 忘情至尊 小说 五蠢 小说 主角因为心脏病比赛点球输了拿了亚军当学校足球校队的教练的小说 主角因为心脏病比赛点球输了拿了亚军当学校足球校队的教练的小说 望君心小说 青春离婚 小说 活死人 加油站小说 待寝将军 艾可 小说 新公司 沙滩 排球 游泳池 小说 恶毒女配翻身记 千千小说 重生亚当 贾羽 小说 雨后小故事 小说版 海贼王之我的玛亚 猫知鱼之乐 小说 岚风 是那部小说的人物 有声小说 美娜4