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
我们的系列txt命中注定在一起txt大圣道txt下载奇书无极魔帝txt免费下载俘美记txt青帝全本txt下载不婚千金txt风流王侯txt深爱之公子谋妻txt创世武神 txt重生之豪门人生txt风流王侯txt穿越之怨偶良缘txt玉堂金门txt下载书包网天骄无双txt网盘创世武神 txt命中注定在一起txt异界之大败类系统txt下载异界之大败类系统txt下载冷峻王爷的丑奴txt神级随身空间txt异界之大败类系统txt下载深爱之公子谋妻txt凤游天下txt花间一壶酒txt我们的系列txt不就偷你一杯子txt下载新浪凤游天下txt冷峻王爷的丑奴txt穿越之怨偶良缘txt李云飞生于官宦人家,自幼文武双全,天资聪颖,后师从江湖名师,在求学期间,父亲遭人陷害,下落不明,母亲和唯一的妹妹惨死家中,从此年仅二十岁的云飞,独自行走江湖,练成绝世武功,为父亲雪耻,替母亲和妹妹报仇,自己也终得,一贤良女子为妻。退隐江湖。恋人被逼身死,他怀着滔天恨意进入天劫游戏中; 本想获得极品职业,却落得最差的游戏属性,堪称绝世废物; 天道酬有志者,他历经千辛万苦终于有所收获; 极品职业,携手佳人、好友共抗恶魔,声名鹊起; 战魂、武魂、血魂、法魂,且看他如何抉择! 大敌当前,且看他如何力挽狂澜! 私仇面前,且看他如何对待爱情、亲情和友情! 国家利益,且看他如何先国后家! 纷扰世间,且看他如何矢志不渝! 道士、忍者、剑士、骑士,中西合璧,各国特色; 精彩网游,一切尽在——网游之九转轮回 是乱世出英雄?还是英雄造就乱世?我叫王凡。 我二十岁收到父亲的生日礼物。 意外得到祭天戒。 本以为自己会成为祖国人的存在。 却发现身边到处都是修真者。 浩瀚无垠的宇宙之中,蓝星只是小小的一粒沙。 生长着几十亿人口的蓝星之中,万伊只是一名小小的警察。 在这片土地上生活了二十多年的他,在某一个平凡普通的日子里,救下了一名古怪的白衣女子,不曾想,却开启了一段离奇的人生。 抚养自己二十多年的爷爷,是所谓人族救世主剑帝。 齐天大圣孙悟空是自己的第一世,得知自己身负拯救人族于水火的使命。 亲眼目睹了何为世间最强一剑。 …… 前路漫漫,不知归处。 他心中只有一愿:砍死那群王八蛋,带老头儿回家。 本书又名《开挂的人生》《板栗终结者》《带着保镖去旅行》《谁TM说老子充钱了?》《武夫万剑仙》等等等等。我挺讨厌张无忌的,没想到穿越成了小说中的男主,可让男主万万没有想到的是 一块不起眼的石头,内里竟然容纳一方世界。少年只是随手一捡,便是陷入沉睡。 十年一梦,梦里十万年。 醒来,家族没落,承受着家族的血脉诅咒,他能否逆天改命。箴言:你在左,我在右,莫回头,煮酒把歌...少年风行逐月夜,青春无载盼悠悠,红尘情剑断如苟,苍渺仙路难觅觅,彼岸花开三杀变,匡匡渠穹夭夭仙!鲲宇虚纳动九天,龙游伏洞藏九地!宙杀时势,天谕机变,苍穹点极,斗转星移!战仙歌,青锋白落谁主星瀚沉浮.....? 乾彪的眼光很长远,做事很爽快,从一名保安队长变成一代尊神,其中经历过酸甜苦辣,过五关斩六将,当上神策宫宫主的女婿是他正确的选择。本书又名《王者修炼》、《你爽你牛》、《星际霸主》等。第三次世界大战之后,环境异变,妖兽丛生,数百年后,资源和能源枯竭,人类即将灭亡,一款名字叫《修仙》的网络游戏承载着延续人类文明的重任。 十万被选中的人类降临网游修仙界,却只传载成功九人,他们为了整个人类,又该何去何从?
转生到异世界修炼成为最强 御兽:我能加速万物进化 仙族长生 古诗歌欣赏 极道使魔 蓝灵沐神 酋长饶命 印记契约 我欲立天 真实网游之启源 大梦道术 这一世,我再次登顶无敌 归墟世界 剑尊他一穷二白 都市绝门医神 鸿天女帝 荒野求生死亡游戏 异世旅人 天陨六星 玄幻:我,修改万物,万古独尊! 灵异txt电子书 大圣道txt下载奇书 天骄无双txt网盘 萌妃难驯邪王追逃妻txt 灵异txt电子书 深爱之公子谋妻txt 创世武神 txt 花间一壶酒txt 时空追缉txt 异界之大败类系统txt下载 羽光txt 羽光txt 萌妃难驯邪王追逃妻txt 杀手相公txt下载 我们的系列txt 俘美记txt 白发皇妃txt下载百度云 时空追缉txt 不婚千金txt 大圣道txt下载奇书 杀手相公txt下载 凤游天下txt 命中注定在一起txt 风流王侯txt 不就偷你一杯子txt下载新浪 萌妃难驯邪王追逃妻txt 时空追缉txt 命中注定在一起txt 不婚千金txt 时空追缉txt 俘美记txt 天骄无双txt网盘 无极魔帝txt免费下载 我们的系列txt 神级随身空间txt 俘美记txt 无极魔帝txt免费下载 创世武神 txt 萌妃难驯邪王追逃妻txt 凤游天下txt 冷峻王爷的丑奴txt 异界之大败类系统txt下载 甄志丙txt 白发皇妃txt下载百度云 风流王侯txt 杀手相公txt下载 羽光txt 冷峻王爷的丑奴txt 萌妃难驯邪王追逃妻txt 灵异txt电子书 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 至尊小仙农 末世:开局战地崛起 人与机器人的末日之战 不醉星河 成为巨星从好声音开始 百度 百度 百度 百度 百度 我们的系列txt 我们的系列txt 创世武神 txt 白发皇妃txt下载百度云 异界之大败类系统txt下载 重生之豪门人生txt 时空追缉txt 神级随身空间txt 大圣道txt下载奇书 异界之大败类系统txt下载 羽光txt 天骄无双txt网盘 重生之豪门人生txt 俘美记txt 村情txt 花间一壶酒txt 萌妃难驯邪王追逃妻txt 萌妃难驯邪王追逃妻txt 我们的系列txt 我们的系列txt 神级随身空间txt 萌妃难驯邪王追逃妻txt 异界龙尊txt全集下载 冷峻王爷的丑奴txt 杀手相公txt下载 穿越之怨偶良缘txt 深爱之公子谋妻txt 灵异txt电子书 不婚千金txt 异界之大败类系统txt下载 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网