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
饿字头像头像头歪歪另类的头像鹿晗头像女夏天头像男饿字头像洗头男头像另类的头像海豚的头像微笑猪头像姓杨头像另类的头像路头像姓杨头像笑头像图片微笑猪头像夏日男头像老牛头像老牛头像本山头像英文男头像老牛头像海豚的头像斜背头头像动漫头像狗学霸字头像动漫头像狗斜背头头像本山头像路头像穿越到文娱行业刚刚起步的平行世界,方淮南激活了影帝系统,可以获得前世任意一位影帝级人物的表演经验! 他一个人就开创了华娱影坛十年的辉煌时刻! 他是《无间风云》里城府深沉的黑帮老大琛哥; 也是《枪燃》里忠义痞气交织的打手阿来; …… 正当所有人都以为方淮南只会演反派角色的时候, 他跑到横店去出演了《猫妖传》里五分钟的配角, 将盛唐气势下,那位如醉似癫的李白演出了神韵! 这时,所有人才知道方淮南的戏路宽阔到何等地步! …… 面对采访,融合了上百位影帝经验的方淮南很谦虚的表示: “我,不过是站在了巨人的肩膀上罢了。”神秘力量入侵蓝星,恐怖复苏降临! 它会随机挑选玩家进入恐怖副本,面临着凶残魔物的进攻! 玩家进入副本会觉醒各种不同的能力! 战斗系,控制系,召唤系,防御系…… 玩家们可以组队联合对抗魔物! 华夏国,漂亮国,岛国,阿三国的玩家们纷纷联合聚集起来,打造本国的最强联盟! 直到白宇进入副本,开局觉醒王者军团! 听说你们的队伍几十号人? 不好意思,我一般都带着一百多号神级小弟出门! 雷电之王·司空震:以雷霆击碎黑暗! 一念神魔·李信:这里是,为我所统率的战场! 炽热神光·镜:怀八荒,入九重! 祈雪灵祝·公孙离:镇守邪祟,荡尽魑魅!一所普通的大学,一名普通的年轻教师,担任一个普通的社团指导老师,然而在这样普普通通的背景下却蕴含着许许多多不普通的事一个神棍道士为了在小镇生存学习死去的师傅招摇撞骗在一次收服鬼魂的事件中慢慢的踏入了修仙的路程。看一个小道如何一步步的崛起与坑人。你的梦你还记得吗?身边的人,陌生的身份,未到过的地方...是在表示什么。这是你的梦,你还记得吗?已经是2678年,地球资源即将枯竭……在一个极度内卷的时代,今天又该如何生存是一半人每天都在思考的问题。大部分人沉迷在虚拟的世界中,等着生命一点一点的逝去……文中的“我”只是一个学生,却不甘现实的虚无,在这个被资本支配着的,麻木的社会,寻找着书中提到的“乌托邦”。 凡间有十二个国家,分别是:子国,丑国,寅国,卯国,辰国,巳国,午国,未国,申国,酉国,戌国,亥国……宫斗,商斗,权谋,军事海陆空作战……仙界:天空悬浮着7座山脉,这7座山脉被红,橙,黄,绿,青,蓝,紫这7种颜色的彩云分别缠绕着……在这7座彩云山脉之上依稀还有一座更高更飘渺散发着金光的山脉……即是玄幻,即是悬疑,即是言情,即是修仙,即是权谋争斗......美好的事,物,人,大家都想拥有,这是一本付出与获得的故事......米虫非女尊的人物特点,是地地道道的小女人,俗世仙山是以米虫的视野,诉说一部群雄的争斗故事……精彩继续……天下除了至高无上的权利,还有法力无边的法宝,强大的仙术;除此之外便是男人们抢夺最美的女子,女人们抢夺最强势顶级的男子......一日之间,我从受人敬仰的师兄变成了门派弃徒。 被师父冤枉后逐出师门?和我出生入死的结拜兄弟背叛了我?就连和我青梅竹马的小师妹也不愿意相信我? 君子周而不比,小人比而不周。且看剑道天才左不比如何从绝境中寻找希望,从不幸的泥潭中奋起,在只身一人的江湖中书写一个属于君子剑的不朽传奇!一个生活在地球上的少年意外的穿越来到了怪物大师的世界里,身为穿越者的他,本该以主角的身份纵横剧情,但谁知却失去了穿越前的所有记忆,最终在医疗怪物大师亚克的帮助下,走向了成为一名怪物大师的道路。 少年一步一步的成长,同伙伴经历众多,同时也寻找着失去的记忆,但他发现,这个世界似乎与其他的世界相连通? 银发紫眸,与他来自同一世界的精灵; 狐耳狐尾,来自云国古都的少女; 继承了深渊神秘力量的刺客;追随光明的少年剑士; 还有背负长枪,身世神秘的少年;背离家族,寻求自由的继承人;挣脱牢笼,飞向辽阔天地的琴女。 ———— 1:本书融合了包括奥拉星,怪物大师,剑灵等作品在内的各种世界观以及大量的自创设定,不喜勿喷。(详细见《阅读指南》) 2:本书同其他几部作品联动,包括《怪物大师伊洛维奇自传》《剑灵风成趣传》《怪物大师新生》等,部分联动作品连载于其他网站上。 交流群:1034283852 作者QQ:3167802402    本文描写一对乡下的老夫妻,一起过着平凡的而甜蜜的生活,苦中作乐,为了能够购买到一辆5000元的三轮车而,老两口不断去努力种地挣钱的故事。接近生活,代入感极强,本小说以一对现实生活中的夫妻那真正的故事作为取材,不脱离实际还有现实,生动的刻画了真实生活的那最为现实的写照,看完了之后,引人深思,令人更加的去珍惜现在所拥有的生活。趁您的亲人好友还在人世,多多珍惜,生活,那是最为苦涩而甜蜜着的。
天色已晚天未亮 冷宫拔剑三百年,我成了绝世剑仙 基因突变之无限穿越 开局我就不是人了?! 世界级魔王的复苏日记 痴神怒 大人饶命 人世间之正道之光 后室 月下祈光者 种田,我靠塔防征服废土 诸天冒险 大唐,开局李二是我爹? 花都邪医俏总裁 江左之盟 七月之火 风影之主 听说有个超能管理局 武都伏妖录 第一次遇见神待少女 手绘熊头像 烂字头像 夏日男头像 夏天头像男 手绘熊头像 yy头像框 夏日男头像 污污头像男 学霸字头像 星月夜头像 扫把污头像 扫把污头像 小犀牛头像 烂字头像 饿字头像 夏天头像男 头像男和狗 学霸字头像 意境人头像 另类的头像 烂字头像 笑头像图片 头像头歪歪 姓杨头像 微笑猪头像 小犀牛头像 学霸字头像 头像头歪歪 意境人头像 学霸字头像 夏天头像男 冷酷女头像 鹿晗头像女 饿字头像 斜背头头像 夏天头像男 鹿晗头像女 夏日男头像 小犀牛头像 笑头像图片 动漫头像狗 星月夜头像 景图头像 头像男和狗 姓杨头像 烂字头像 扫把污头像 动漫头像狗 小犀牛头像 洗头男头像 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 血门关 净身出户的我火爆娱乐圈 我被丧尸世界坑惨了 消失的罪人 猛虎与恋情 欧博官网 百家乐官网 澳门葡京游戏官网 欧博官网 亚星游戏官网 炸房头像 意境人头像 污污头像男 小犀牛头像 扫把污头像 动漫头像狗 动漫头像狗 英文男头像 意境人头像 头像男和狗 斜背头头像 头像头歪歪 笑头像图片 姓杨头像 扫把污头像 学霸字头像 老牛头像 英文男头像 微笑猪头像 扫把污头像 头像男和狗 鹿晗头像女 鹿晗头像女 英文男头像 英文男头像 夏日男头像 头像男和狗 意境人头像 学霸字头像 景图头像