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
漫画男生排行榜漫画男女合体肉图漫画男生突然吻女生漫画踮脚的图片漫画店的监督漫画男生和男生漫画魔幻武器图片大全漫画男生突然吻女生漫画男男搞基动态图像漫画喵怎么退出分享漫画水中漫画男生排行榜漫画魔法罗漫画帅哥图片带字图片大全图片大全图片漫画男生突然吻女生漫画喵怎么退出分享漫画魔幻武器图片大全集漫画店危机漫画店危机漫画男人与女人漫画男女短漫画店危机漫画男男搞基动态图像漫画男人哭漫画店的监督漫画男女揉胸大全集漫画踮脚的图片漫画男人哭漫画男人妖搞基过程图漫画魔法罗 你可曾想过,在都市的灯火阑珊下,除了你所认知科学,是否还潜伏着无人问津的生物? 在血与暗的深渊里,黑暗即将笼罩,迈向光明之路,注定荆棘丛生,然而再这之后,就是永恒的黎明! 机缘巧合下,陈烨与一群特殊的群体产生了羁绊,从而接触到了这个世界隐藏的一面——异能界。从此,平静的生活止步于那个夜晚,不断有怪物找上自己,为了活下去,陈烨加入到了“黎明”组织中,并为揭开世界的面纱而去奋斗。夜晚的霓虹下,壁垒中的人类尽情的放纵着自己的激情。 但他们并不知道,阴影中的怪物们正死死的盯着他们,随时准备着剥夺他们的生命。 这些怪物隐藏在人群之中,嘲笑着人类的无知与愚昧。 十八岁的李如一却有着能够找出他们的技能——回溯。 六年前,李如一穿越到了这个科技发达且充满危险的异世界,为了成为超凡者而不懈努力; 六年前,两个猎魔人偷偷潜入13区19号城市; 六年前,一个叫做任小兰的老妇人牺牲了自己的生命; 六年前,一场大火烧毁了一个希望; 六年后,一个中年男人和一个老人下着棋,聊着天。 老人问道:“你难道不知道李如一很可能会毁掉这个世界吗?” 中年男人说道:“但他也有可能拯救这个无药可救的世界啊,不是吗?” 面对死灵族,封印着怪兽八梼的佣兵,最后能否成为拯救世界的力量?神秘的空间系元素亲和力,诡异的星辰剑,亚夏人的先祖吴道轩视乎留下了什么秘密……孟沧渊作为一一个时代的传奇,帮助孟家成就霸主地位以后,找了个小山村隐居起来,只想平平淡淡的过完余生,偶尔治病救人,刚安稳的度过了几年,老友来访后,带来了无止境的麻烦,孟沧渊:老子欠你的嘛?【叮,您的神级搞钱系统已激活!】 伴随着系统的提升声,李凡终于明白了人生的真谛:那就是拼命的搞钱! 李凡借助系统给予的能力,卖配方、开面馆、创业投资一条龙。 秘制水煮肉片,鲜美嫩辣! 天外香炸鸡腿,外酥里嫩! 神级土豆牛腩,酱香浓韵! 除了各种自创顶级菜品外,还有蒸羊羔、蒸熊掌、蒸鹿茸、烧花鸭、烧雏鸡、烧子鹅、卤煮咸鸭、酱鸡、腊肉、松花、小肚儿、晾肉、香肠……等绝味厨艺! 从面馆开始,李凡创业后倚靠着无数神级配方在美食界横行霸道、平步青云的故事拉开序幕…… 作为海城警局刚刚入职的萌新,程望打死也想不到,有一天会和鬼打交道。 给鬼做饭,陪鬼逛街,跟着鬼探案,跟着鬼捉鬼…… 等等等等!鬼捉鬼? 哦哦,原来是鬼仙!还是个仙子!! 仔细看看,这鬼仙长得还蛮好看的。 其实,和鬼仙呆在一起,还算不赖。 可是你要回你的苦厄界,我还要混迹在这尘世间,你我二人总是要散场的。 别哭了,我再陪你捉最后一只鬼。 好吗?苏霁尘被系统给坑了,在娘胎里面一待就是十年。 【叮,签到成功,获得至尊剑骨】 【叮,签到成功,获得混沌道体】 【叮,签到成功,获得不灭金身诀】 【叮,签到成功,获得斩天拔剑术】 那一日,紫气横盖三万里,至尊降生。 混沌道体,手持祖剑,身上不灭金身,至尊剑骨让万族臣服。 十年之期满,苏霁尘降生。 苏霁尘:“太强了不给出生?我反手就将老娘堆成仙!” 爱情是互相成就的一段旅程。这个男人有三任妻子。第一任是少年懵懂时期爱上的清纯感性的妻子。第二任是青年创业时期遇到性感聪明的妻子。第三任是事业有成的中年时期遇到的妻子。如果可以男人也希望可以从一而终。扣心自问,17岁的少年期的他在少女害羞低头一笑露出的浅浅酒窝。犹如娇艳欲滴含苞待放的玫瑰这是他这辈子唯一一次真正的动心。为了心中的正义法官老爹的艰难前路,追求人生的超脱律师儿子的接案经历。一部家族的奋斗史,三代父子的命运路。神棍少年来到异世界招摇撞骗,当个山大王,掀翻三界,让玄幻世界从此体验华夏文明的魅力
摊牌了,我有最强鬼王系统 她与罪同行 GTA:09年末的故事 神豪:我呼吸就赚钱 玄凌大陆 修真小捕快 异世能 雪上情缘 踏武入圣 闪耀深空 大武不良人 那小师叔真帅 黑色兰花劫 重回二十岁,绑定第二系统 一个工作狂的重生之旅 秦始皇的新生 斩阴 谋族篡位 上门猛婿 成为道士的那些事 漫画男女合体肉图片 漫画水中放柳叶啥意思 漫画魔幻武器图片大全集 漫画店危机 漫画男女合体肉图片 漫画男人 岛 女人 漫画男哭泣趴地上 漫画冥王 漫画男女揉胸大全集 漫画魔法罗 漫画男男搞基动态图像 漫画男男搞基动态图 漫画男人生宝宝 漫画喵怎么退出分享 漫画男生和男生 漫画店的监督 漫画男哭泣趴地上 漫画男女揉胸大全集 漫画男女短 漫画男生排行榜 漫画水中放柳叶啥意思 漫画男生突然吻女生 漫画男女合体肉图 漫画帅哥图片带字图片大全图片大全图片 漫画喵怎么退出分享 漫画男人生宝宝 漫画男女揉胸大全集 漫画男女合体肉图 漫画男女短 漫画男女揉胸大全集 漫画店的监督 漫画水中放柳叶啥意思 漫画男童喂奶 漫画男生排行榜 漫画男人哭 漫画店的监督 漫画男童喂奶 漫画魔幻武器图片大全集 漫画男人生宝宝 漫画男生突然吻女生 漫画踮脚的图片 漫画魔法理发店结局 漫画男人与女人 漫画男男搞基动态图 漫画帅哥图片带字图片大全图片大全图片 漫画水中放柳叶啥意思 漫画男男搞基动态图 漫画踮脚的图片 漫画男人妖搞基过程图 漫画魔幻武器图片大全 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 幕府医师 逐梦NBA 妖孽小官人 幻生秘遇 轮回世界:只有我知道剧情 葡京官网 欧博官网 亚星管理平台 葡京官网 皇冠登3出租 漫画踮脚的图片 漫画魔幻武器图片大全集 漫画男人 岛 女人 漫画男男搞基动态图 漫画魔幻武器图片大全集 漫画男生和男生 漫画男男搞基动态图 漫画男女短 漫画男人妖搞基过程图 漫画男女短 漫画冥王 漫画男女合体肉图片 漫画喵怎么退出分享 漫画店的监督 漫画魔法理发店结局 漫画男人哭 漫画魔幻武器图片大全 漫画男人哭 漫画店的监督 漫画男人与女人 漫画男人生宝宝 漫画喵怎么退出分享 漫画男人妖搞基过程图 漫画男生排行榜 漫画水中放柳叶啥意思 漫画男生突然吻女生 漫画男女短 漫画踮脚的图片 漫画男女短 漫画魔幻武器图片大全