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 in Bootstrap utilizes 12 columns that render out at widths of 724px, 940px (default without responsive CSS included), and 1170px. Below 767px viewports, the columns become fluid and stack vertically.

<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

p>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="span6">
        Level 1 column
        <div class="row">
            <div class="span3">Level 2</div>
            <div class="span3">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>

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>

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: 767px) { ... }
  /* Portrait tablet to landscape and desktop */
  @media (min-width: 768px) and (max-width: 979px) { ... }
  /* 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 hiding 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
一岁宝宝被水烫了没起泡怎么办宝宝脱水几天能好宝宝比实际孕周小半个月正常吗一岁半宝宝不宜吃那些水果宝宝多大奶结会少一岁宝宝被水烫了没起泡怎么办二岁宝宝发型宝宝比实际孕周小半个月正常吗宝宝身上痣突出来了发痒2016出生宝宝起名大全宝宝喝椰子汁一岁宝宝被水烫了没起泡怎么办刚满月的宝宝脑门不会动怎么回事宝宝喝椰子汁宝宝比实际孕周小半个月正常吗宝宝疤痕修复膏三个月宝宝的囱门应该多大宝宝多大奶结会少宝宝多大奶结会少宝宝天天吃蛋黄好吗酸奶条适合宝宝吃吗生完宝宝来月经腰疼怎么回事宝宝身上痣突出来了发痒宝宝大便有黏液怎么治疗十六个月宝宝可以喝蜂蜜水吗4个月宝宝头皮油脂旺盛怎么办一岁半宝宝不宜吃那些水果产后13天的宝宝应喝多少白开水宝宝天天吃蛋黄好吗宝宝头发少但是不缺钙你可知道茫茫人海之中,有些看似平凡的人其实身怀绝技?他们可能是楼下小卖铺的老板,有可能是公司白领,也有可能是快递员······ 凡修炼之人必要渡劫,但这劫难并非天雷地火的磨难,而可能是生活中的每一件小事。 而袁逍的劫,前无古人后无来者,竟然需要天下人来助!十年前,魔教大开杀戒、血洗武林。中原各路侠客、武者共同御敌,终于将其逐出关内,十年后,魔教重新入关,欲想再度统治中原武林,叶无风等人为保一方安危,浴血奋战……一座恐怖的公司,月薪300w,但是会发生许多灵异事件。给你钱你敢来吗?意外穿越,借尸还魂,王凯旋成了“战国诛妖人”。于是,他欣然受命,开始了叱咤风云的诛妖之旅…… 本书又名《开着飞机打妖怪》、《在战国的诛妖生活》——其实这是《成年人的童话》。 【画外音】 读者甲:“开着飞机打妖怪,这不科学呀!” 读者乙:“就是,战国哪有飞机?” 读者丙:“这书靠谱吗?” 读者丁:“作者这是在异想天开!” 千古絶唱笑道:“天下万事,皆有可能。诸位若不相信,跟书追读便见分晓……” 元宇宙时代,机缘巧合之下,大一学生林泽成为了一座鬼屋中的扮鬼NPC,意外发现自己工作的鬼屋竟是一场真实的杀人游戏。 明明是残忍血腥的鬼屋,却被他玩出了奇怪的画风...... 林泽:一名真正敬业且专业的NPC,不仅要吓人,还要能吓鬼。 鬼屋众鬼:你不要过来啊——在超一线城市当贫困户怎么办? 别慌,本系统带你装逼带你飞! 秦寿:系统,你不是人,但你是真的狗啊! 系统:嗯哼,你最近有点飘啊!信不信本大爷解绑? 秦寿:系统爸爸我错了! ………………………爱情的路上没有对错,有的只是遇见与错过。。。 王卿穿越到远古时代,成为饕餮,才统治了这个世界,就被憨憨校花给召唤了,成了她的契约兽!   最离谱的是,连说话的权利都没有了。   “喵?”   “喵你个头啊!”   ......   我叫苏天天,被称为青阳学院的甜美校花!   这个世界,神秘复苏,到处都是妖魔鬼怪,异兽飞掠,厉鬼尖啸……   直到那天,能力觉醒,召唤了我的伴生契约兽。   然而我听到的第一句话就是:“喵?”   一只长得跟小黑狗一样的东西,开口居然是喵喵叫!   夭寿啦~~ 两世为人,为了阻挡异族入侵,诡异横行的异世界中,夜风流化身二流骑士,肉身锤怪,一路秒..喵喵。 中二少年的奇幻之旅,假面骑士的视觉盛宴! (前面都是假的,其实就是吐槽吐槽码字挺累的,大家送送礼物啥的。) 网瘾少年林徉魂穿大武朝,凭借着网上冲浪的经历纵横武朝! 造纸?我会古法造纸; 赶海?这个季节的沙滩有很多花旦蟹; 行医?脸上出现蜘蛛斑,一抹无痕。 ……
不朽剑帝:剑阁观剑一百年 我的皇室血统 走错厕所被女教授给揍了 盗墓诡异录之九层古冢 银河战争之猎户座旋臂 我的世界之颠倒模组 巅峰之武道无双 帝谕龙章 创天主宰 文书剑气 我叫李元 末代天师诡谈 逆者为皇 别吵了,你们宗门的天骄都是我 铁血之人的无限之旅 全名转职开局转职黑暗法师 克利西亚 都市奇门怪医 理想世界之天地起源 龙野传 4个月宝宝头皮油脂旺盛怎么办 宝宝疤痕修复膏 宝宝吃肉发烧 宝宝多大奶结会少 宝宝脱水几天能好 产后13天的宝宝应喝多少白开水 宝宝吃肉发烧 一岁宝宝吃了肥皂 宝宝腿上有紫色的小点 刚满月的宝宝脑门不会动怎么回事 羊宝宝哪日出生好 羊宝宝哪日出生好 宝宝大便有黏液怎么治疗 宝宝疤痕修复膏 一岁宝宝被水烫了没起泡怎么办 十六个月宝宝可以喝蜂蜜水吗 宝宝上火不爱喝水 4个月宝宝头皮油脂旺盛怎么办 80天宝宝喜欢大人扶坐可以吗 宝宝比实际孕周小半个月正常吗 宝宝吐喝什么药 宝宝比实际孕周小半个月正常吗 80天宝宝喜欢大人扶坐可以吗 生完宝宝来月经腰疼怎么回事 2016出生宝宝起名大全 宝宝不注意人脸 4个月宝宝头皮油脂旺盛怎么办 80天宝宝喜欢大人扶坐可以吗 80天宝宝喜欢大人扶坐可以吗 宝宝腿上有紫色的小点 宝宝多大奶结会少 宝宝吐喝什么药 一岁半宝宝不宜吃那些水果 一岁宝宝被水烫了没起泡怎么办 宝宝大便有黏液怎么治疗 十六个月宝宝可以喝蜂蜜水吗 一岁半宝宝不宜吃那些水果 宝宝吃肉发烧 宝宝大便有黏液怎么治疗 2个月的宝宝晚上一般好久醒一次 十六个月宝宝可以喝蜂蜜水吗 一岁宝宝吃了肥皂 宝宝天天吃蛋黄好吗 宝宝上火不爱喝水 宝宝喝椰子汁 宝宝吐喝什么药 羊宝宝哪日出生好 十六个月宝宝可以喝蜂蜜水吗 宝宝不注意人脸 三个月宝宝的囱门应该多大 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 猿神录 我以一指,镇压诸天 流浪在仙界 天赐使徒 温柔的背叛 欧博官网 亚星官网 万利游戏官网 欧博官网 澳门葡京游戏官网 宝宝大便有黏液怎么治疗 2个月的宝宝晚上一般好久醒一次 4个月宝宝头皮油脂旺盛怎么办 宝宝吐喝什么药 宝宝脖子里一片红 三个月宝宝的囱门应该多大 三个月宝宝的囱门应该多大 2个月的宝宝晚上一般好久醒一次 2个月的宝宝晚上一般好久醒一次 宝宝天天吃蛋黄好吗 宝宝喝椰子汁 一岁半宝宝不宜吃那些水果 二岁宝宝发型 宝宝身上痣突出来了发痒 宝宝脖子里一片红 宝宝多大奶结会少 宝宝上火不爱喝水 宝宝比实际孕周小半个月正常吗 宝宝脱水几天能好 宝宝脖子里一片红 宝宝天天吃蛋黄好吗 二岁宝宝发型 二岁宝宝发型 宝宝比实际孕周小半个月正常吗 2个月的宝宝晚上一般好久醒一次 宝宝不注意人脸 宝宝天天吃蛋黄好吗 一岁半宝宝不宜吃那些水果 宝宝多大奶结会少 2016出生宝宝起名大全