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
bl玩脚漫画图片大全bl强制虐身漫画樱狩bl玩脚漫画图片图库bl学生攻老师受漫画图片bl游戏王漫画图片bl玩脚漫画图片大全boss哥哥你欠揍漫画64bl玩脚漫画图片图库18禁漫画无遮挡在线bl孕交漫画图片bl有多肉漫画图片bl玩脚漫画图片大全boold bank漫画百度云bl有多肉漫画图片bl玩脚漫画图片图库bl孕交漫画图片boss哥哥你欠揍漫画70bl游戏王漫画图片大全集bl游戏王漫画图片大全集bl同人漫画18rbl漫画正太贴吧bl有多肉漫画18禁漫画哪买bl肉漫画无修bl游戏王漫画图片bl肉处漫画图片bl学生攻老师受漫画图片bl肉漫画txt微盘bl同人漫画18rboold bank漫画百度云这是一个神魔妖仙佛并立的世界,这是一个诸天万界混乱的年代,苍灵神尊销声匿迹之后,诸天万界混乱不堪,各方势力雄踞一方,硝烟四起,混战不断。 数千年后,他的出现改变了诸天万界战乱的时代,他的出现也引领了一个新的时代,斩天道,踏轮回,出生平凡的他,有着远大的抱负,不屈服于命运的安排,突破上苍的桎梏,他的逆天征途将由血骨铺路。这是一个崭新的世界,在这个世界没有魔法斗气,只有五彩斑斓的元素充斥着整个世界. 每个人只要到了十岁就可以进行元素修炼,通过自身的感悟和运用进行战斗。 而这本书主要是讲述一个没有元素感知力的少年,是如何一步步称霸一方统领一界的......写手一个,喜欢随手写一些玄幻类型,如有指教请来。神恩星域,万族林立 ,天地纵横,妖魔横行,强者如云,强者如雨,强者遍布整个宇宙星空中。 看少年如何问鼎神恩星域之巅,诸神俯首宋帝都临安府爱国人士:吴俊振,与用时光机穿越过来的现代大学生:马维,两人一起被龙卷风漩涡黑洞带着,穿越到了明崇祯十六年公元1643年兴都留守司显陵卫境内,在机缘巧合之下他们俩主动应征入伍参军,从此开启一段帮助大明帝国收复失地的旅程,本文群号799968110一个高中毕业的学生,带着一个幸运的锦鲤穿越各种平行世界,在各种平行世界中,他都是最强大的那个人...玄龙大陆,以武为尊。 少年叶平安得到败天武帝的至尊天眼,从一个卑微的蝼蚁,成为至高无上的绝世武帝! 一路上白骨累累,红颜多娇路飘摇,无敌路上太寂寥!神圣再现,风云再起,旧时代未葬下的魔,就由我来终结。(作者是个小白,文笔不好!)曾为前世顶尖杀手的姜扬,因为人的贪欲转生至异世界,将整个世界带到万劫不复之地,成为‘魔主’主角降生之日,被称为‘魔临之日’!滚滚5000年长河中,有多少的意难平啊?而如今,一个人来到了三国时期,它拥有着改变这一切的机会,他又会做如何选择?或者他有什么选择的办法?这一切的一切到底该如何是好?当霍去病与王昭君产生羁绊,当项羽再次遇到虞姬,当曹操一转身,发现自己的五子良将变成吕布的八健将,这一切的一切又该如何探索?这终究将成为一场世界性的决战,这是最精彩的时代,这是最混乱的时代
荒事 曼珠沙华之昆仑山 元宇宙:开局进入西游争霸世界 剑狂无酒 极桓九 九则人世间 建座地府当后宫 离鸿少年游 我真的很稳健啊 界阙 大周败家子 群星挑战之星神之路 回乡的奇妙之旅 天临世间 修炼一道 一人一剑一江湖一世界 重生在三国之三朝四国志 太荒至尊诀 米瑞斯之光芒前奏曲 异度虚空 bl肉处漫画 bl有多肉漫画图片大全 boss哥哥你欠揍漫画70 bl游戏王漫画图片大全集 bl肉处漫画 bl肉处漫画图片大全 18禁漫画巨乳教师 bl重口味漫画 bl肉处漫画图片 boold bank漫画百度云 18禁漫画哪买 18禁漫画哪买 bl肉漫画无修 bl孕交漫画图片 bl兔女郎漫画h bl游戏王漫画图片 18禁漫画妈妈和我 bl肉处漫画图片 bl漫画正太贴吧 bl玩脚漫画图片大全 bl有多肉漫画图片大全 bl玩脚漫画图片图库 bl强制虐身漫画樱狩 bl有多肉漫画 bl重口味漫画 bl肉漫画无修 bl肉处漫画图片 bl强制虐身漫画樱狩 bl漫画正太贴吧 bl肉处漫画图片 bl游戏王漫画图片大全集 bl有多肉漫画图片大全 bl学生攻老师受漫画图片 bl玩脚漫画图片大全 bl肉漫画无修 bl游戏王漫画图片 bl妄想童话耽美漫画 18禁漫画巨乳教师 bl肉漫画无修 bl妄想童话耽美漫画 bl游戏王漫画图片 bl做到怀孕的肉肉漫画 bl同人漫画18r 18禁漫画妈妈和我 bl有多肉漫画 bl有多肉漫画图片大全 18禁漫画哪买 bl学生攻老师受漫画图片 bl同情漫画全集 boss哥哥你欠揍漫画64 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 幻世修仙录 网游之天命大法师 赵泰镇南 地表最强高手 饥土 万利官网 欧博官网 皇冠登3出租 万利官网 快连下载 18禁漫画哪买 bl兔女郎漫画h bl有多肉漫画图片大全 bl妄想童话耽美漫画 bl玩脚漫画图片大全 boom工作室漫画 bl玩脚漫画图片图库 bl游戏王漫画图片 boold bank漫画百度云 bl游戏王漫画图片大全集 bl肉处漫画图片大全 bl有多肉漫画图片 bl肉处漫画图片大全 18禁漫画哪买 bl肉漫画txt微盘 bl孕交漫画图片 bl同人漫画18r bl重口味漫画 18禁漫画哪买 boold bank漫画百度云 bl重口味漫画 bl肉处漫画图片 bl做到怀孕的肉肉漫画 boss哥哥你欠揍漫画64 bl肉处漫画 boss哥哥你欠揍漫画70 bl游戏王漫画图片 18禁漫画妈妈和我 bl游戏王漫画图片 bl同人漫画18r