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
狗狗吃牙高有事吗狗狗吃完磨牙棒猛喝水狗狗吃羊奶要喝水吗狗狗吃异物异物后饮食狗狗吃鱼刺咋办胃痛狗狗吃牙高有事吗狗狗吃什么药会睡着狗狗吃羊奶要喝水吗狗狗吃完饭就干呕狗狗吃什么补充矿物质狗狗吃玉米的好处狗狗吃牙高有事吗狗狗吃什么会自然的死亡狗狗吃玉米的好处狗狗吃羊奶要喝水吗狗狗吃什么变壮狗狗吃酸的就咬人嘛狗狗吃鱼刺咋办胃痛狗狗吃鱼刺咋办胃痛狗狗吃西瓜籽怎么办狗狗吃完饭就干呕怎么回事狗狗吃鱼胆行吗狗狗吃完饭就干呕狗狗吃西瓜拉水狗狗吃鱼刺卡住一直吐狗狗吃完头孢吗狗狗吃异物异物后饮食狗狗吃西瓜会拉稀吗?狗狗吃西瓜籽怎么办狗狗吃什么肉增肥有的人穷困潦倒,有的人纸醉金迷,万般皆是命,半点不由人。 给你一个机会,让你重新选择你的人生,在这里,你可以获得财富、地位、美女、跑车,一切按照你的设定来重新选择!走进这本书,感受万千人生下的千滋百味! 【元宇宙-惊悚世界】 “我不想死啊!” “妈妈救我,我不要进入惊悚游戏!” “救命!救命!有没有人,快把我放出去!” “我是XX大明星,谁愿意救我,你要我做什么都可以!” 惊悚游戏降临全球,每个月随机抽取大量人类进入游戏世界与厉鬼为伴。 当所有人都在惶恐、害怕、恐惧中苦苦求生的时候,第一次进入游戏的陈凡发现,他每次开始游戏前居然能先抽取一件强大鬼物! 鬼外卖游戏中,当别人还苦哈哈骑着纸扎的电动车给鬼送外卖时,陈凡已经骑着猛鬼摩托在大街小巷风驰电掣,单单好评。 当别人好不容易与一只鬼签订契约的时候,陈凡已经拥有了一堆鬼王,组建了第一支人类为首领的鬼军!震撼两个世界! 他麾下的女鬼,实力无比强大,更是个个国色天香,对林风死心踏地。 赚取无数金钱的女鬼总裁,神秘强大的幽界之主,拥有僵尸大军的飞僵女王,修炼千年的倩魂姐妹……监狱禁闭室中有句话人尽皆知,有朝一日龙抬头,定让黄河水倒流,有朝一日虎归山,定让血染半边天。 &amp;quot;北冥有鱼,其名为鲲。鲲之大,不知几千里也。化而为鸟,其名为鹏。鹏之背,不知几千里也......&amp;quot; “:有一天我一定要像鲲鹏一样翱翔于天地之间,畅游于四海之内,载物助人”辰羽激动地说道。 可直到意外到来,鲲鹏之语告诉他修仙的真谛...... 太玄大陆,五位最强者,被称为神。某天,一场大战过后,大陆中最年轻的神失踪,恰逢一座小城池,一位少女问旁边的少年说:“你将来想做什么呀?”少年冷漠的回答:招兵买马、踏破龙阳。本作品纯属本人刘嘉述琐碎生活中的一部分,书中提到的人物名称均为亲朋好友的外号及化名,选择性塑造出各个阶层为了生活奔波劳累的奋斗史!书中人物形象刻画均与现实人物相辅相成!还原度98%!多谢大家捧场阅读!上古年间,随着创世五神陨落,大地陷入混乱当中,无数强者相序崛起,争夺着五神遗留的,那为数不多成神的机缘。 经过万年的厮杀,无数的神明相序出现,局面也渐渐的到控制,大地看似再一次恢复宁静,实则暗流涌动。 在这期间一个人的出现,让这不安的局面再一次爆发。 古小溪一个古怪神秘的人。 他拥有令神都嫉妒的恐怖灵魂,却也为此差点殒命。 他无心争夺神位,却凭一己之力挑战神明。 这一切只为心中的执念,那个他出现的唯一目的,刹瓦娜之魂。 神明布下游戏,每个人都可以参与并拥有变身铠甲的能力,不同的召唤器散落世界,获得它的人会变得如何呢?剑走轻灵,取日月之息,潇洒江湖。然而,剑道漫漫,成功者寥寥无几。在世间剑修没落的时候,一位少年阴差阳错走上了习剑之路……张风误打误撞的来到了一个未知的世界,未知的时空。纷乱的世道,混乱的种族,让张风的目标变得遥不可及。好在有几位落魄的大妖相助,张风开启了自己在这个时空的争霸生涯。
末日卡牌:打造最强庇护所 单身狗修仙 娱乐第一天王 念凡纪元 漆黑的光芒:魔法背叛 星际扫地机器人 别把岁月留下 夜辉之暗月之光 梦里追凶 神契假面 过山车 逍遥鬼主 驭心志 全球高武:刷怪成神,我打穿了人类禁区 这个寻宝系统真香 开局抢亲:老婆竟是女帝之资 神鬼莫判 最后的王座之轮回 彼岸途 吞天帝仙 狗狗吃什么会自然的死 狗狗吃西瓜籽 狗狗吃鱼刺卡住一直吐 狗狗吃完头孢眼睛红 狗狗吃什么会自然的死 狗狗吃什么肉增肥 狗狗吃鱼刺咋办胃痛 狗狗吃虾吗 狗狗吃什么会自然的死亡 狗狗吃羊奶要喝水吗 狗狗吃玉米的好处 狗狗吃玉米的好处 狗狗吃酸的就咬人嘛 狗狗吃西瓜籽怎么办 狗狗吃完打虫药流鼻涕 狗狗吃完头孢吗 狗狗吃鱼刺咋办胃痛 狗狗吃完头孢吗 狗狗吃完狗粮后咳嗽 狗狗吃羊奶要喝水吗 狗狗吃玉米的好处与坏处 狗狗吃羊奶要喝水吗 狗狗吃完狗粮后咳嗽 狗狗吃鱼胆行吗 狗狗吃什么补充矿物质 狗狗吃西瓜籽 狗狗吃完头孢吗 狗狗吃完狗粮后咳嗽 狗狗吃完饭就干呕怎么回事 狗狗吃完头孢吗 狗狗吃鱼刺咋办胃痛 狗狗吃玉米的好处与坏处 狗狗吃异物异物后饮食 狗狗吃牙高有事吗 狗狗吃西瓜拉水 狗狗吃鱼刺卡住一直吐 狗狗吃异物异物后饮食 狗狗吃糖的好处 狗狗吃西瓜拉水 狗狗吃异物多久吃东西 狗狗吃鱼刺卡住一直吐 狗狗吃什么会自然的死 狗狗吃西瓜籽怎么办 狗狗吃桃 狗狗吃玉米的好处 狗狗吃玉米的好处与坏处 狗狗吃完打虫药流鼻涕 狗狗吃鱼刺卡住一直吐 狗狗吃西瓜籽 狗狗吃酸的就咬人嘛 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 血月影 起航时代 不完美重生之都市修仙 混沌王尊 小白幻想曲 万利官网 欧博官网 皇冠登3出租 万利官网 快连下载 狗狗吃完打虫药流鼻涕 狗狗吃牙高有事吗 狗狗吃什么变壮 狗狗吃什么会自然的死亡 狗狗吃什么会自然的死 狗狗吃异物异物后饮食 狗狗吃完磨牙棒猛喝水 狗狗吃西瓜拉水 狗狗吃鱼刺卡住一直吐 狗狗吃鱼胆行吗 狗狗吃鱼刺卡住一直吐 狗狗吃完饭就干呕怎么回事 狗狗吃玉米的好处与坏处 狗狗吃什么会自然的死亡 狗狗吃完饭就干呕 狗狗吃鱼刺卡住一直吐 狗狗吃羊奶要喝水吗 狗狗吃什么药会睡着 狗狗吃完头孢吗 狗狗吃西瓜拉水 狗狗吃完头孢眼睛红 狗狗吃桃 狗狗吃鱼刺咋办胃痛 狗狗吃什么变壮 狗狗吃西瓜会拉稀吗? 狗狗吃完饭就干呕 狗狗吃桃 狗狗吃羊奶要喝水吗 狗狗吃完饭就干呕 狗狗吃完磨牙棒猛喝水