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
宫锁心玉片尾曲歌词我们都已经老了歌词耍成都歌词复眼歌词厨师歌词语宫锁心玉片尾曲歌词明明说好不哭歌词完整版耍成都歌词山外楼高歌词我愿做你的依靠歌词宅男歌词耍成都歌词隐形的翅膀谱子加歌词宅男歌词耍成都歌词周杰伦公主病歌词星动力(星战版)歌词歌词外界厨师歌词语周华健花旦歌词扇子舞老干妈歌词下载歌词外界山外楼高歌词诺澜歌词冰雪歌词哥哥不来花不开 歌词冰雪歌词烧麦的歌词周华健花旦歌词有一句歌词感受你的体温特战精英深入敌后昆捣毁了敌人的雷达站,在敌人的导弹轰击下昏迷被俘,从此开启了为被俘士兵雪耻,捍卫华厦掘起的征程。性格孤僻的天才警官南港市公安局东海分局局长北海琼月只有一个愿望——成为一名恪尽职守、秉公执法的优秀警察。她从不怀疑自己的能力,坚信自己能做到让每一起案件水落石出,不料南港市发生的一系列连续凶杀案让一向被誉为神探的北海琼月焦头烂额,被害者不仅毫无共同点,而且死因离奇。北海琼月身为专案组长一直希望尽快破案,不料一件又一件事情打乱了她的计划…… 正在北海琼月被一个个意外弄得焦头烂额的时候,案件出现了一丝转机,有人目击到凶手犯案的过程,甚至在案发现场活捉凶手。本该为此举杯庆祝的北海琼月却陷入了沉思,这个被逮捕的凶手不是别人,正是和她一起上学、一起工作、一起办案的她唯一的朋友。 友情的信任遭到了巨大的冲击。作为警察,北海琼月有义务履行职责;但作为朋友,北海琼月不相信她是凶手。信任和证据面前,北海琼月必须做出抉择。 秦枫,六大世家秦家独子。 在一次任务中遭遇埋伏,师傅因保护他而死,自己也经脉寸断,武功俱废。 …… 是苟活一世,还是重头来过。 一人一剑,书写属于他的都市传奇。活在这个动乱的年代,身为江湖大佬的许锐锋已经很疲惫了,当他准备相亲过点小日子时,没想到竟然相亲相回来一个间谍…… 她,深入敌营窃取情报; 她,组建底下情报网络向中央传递信息; 她,在敌后无孔不入,备受嘉奖。 当全世界都以为这个女人是王牌特工时,她,却矮下了身子正在给许锐锋洗脚。 因为她知道,没有这个男人,自己早死了成千上万回,而整个北满的日本人都在以抓到这个男人为荣。 他,就是北满第一杀手,左手枪王,北满地下秩序的统帅,大老许。情感将一个学生的追忆用时间镌刻。2022年地球伟大宇航员恒牧在太空中进行新一轮的航天探索时被不明生物袭击,在将死弥留之际被无数光雨覆盖带到了另一个世界雨卿的身体里,他将和雨卿在这片广大无垠的大陆走出什么样的路......身患绝症,无力回天。 机缘巧合,凌凡绑定振兴武道系统,担负振兴武道之重任! “我这一拳二十年的功力,你挡得住吗?” 一拳之下,树干爆炸! 然而,传武失去信任,各种声音不断。 “传武都是垃圾!” “除了样子好看,这玩意有杀伤力?” “练武有什么用?大人,时代变了!” 可当凌凡武道通神,一脚踢飞货车!两指夹住子弹时。 全网炸裂!掀起武道狂潮!厌倦神仙无尽的岁月,能力越大,岁月流逝越久,舟只觉得心中越发空虚,他放弃了无尽岁月,甘愿人间一旅,哪怕昙花一现,他明白有些东西越少才越珍贵……平常的街道,平常的高楼大厦,平常的世界,可人却不平常,有些人天生就被上天眷顾,拥有着能与武器绑定的强大能力,他们名为心系者…末日,男主莫名获得了召唤系统的力量。 难道又是俗套的丧尸生存?不不不,就算在异界,我也有金手指! 在人类世界建立自己的联盟,在异界接收大佬的组织。 拯救世界,还得交给我来干!
穿越二十年又双叒叕穿越了 笙之物语 虚无星海图 弑神之六界灭亡 黄泉不死心 远望2020之重回1982 论画饼,我是专业的 血染的风采燕然勒功 旅行猫咪,开局送来响雷果实 噬古残芒 为新神的诞生献上荆棘王冠 穹顶之上谁主沉浮 源法师 末世之仙道难觅 我在凡间当鬼差 我的禽与兽 风流狂兵俏天骄 入了魔道,然后嫁给哥哥 骄阳夏日无 某咸鱼少女的日常生活 哥哥不来花不开 歌词 周杰伦公主病歌词 跟着风筝飞歌词 厨师歌词语 我们都已经老了歌词 烧麦的歌词 跟着风筝飞歌词 10 pm歌词 遗珠歌词 隐形的翅膀谱子加歌词 任贤齐太平洋歌词 任贤齐太平洋歌词 诺澜歌词 周杰伦公主病歌词 宫锁心玉片尾曲歌词 冰雪歌词 曾经沧海周深歌词意思 哥哥不来花不开 歌词 军中绿花伴奏带歌词的 耍成都歌词 周杰伦公主病歌词 耍成都歌词 军中绿花伴奏带歌词的 歌词外界 我愿做你的依靠歌词 命运这首歌歌词 哥哥不来花不开 歌词 军中绿花伴奏带歌词的 军中绿花伴奏带歌词的 遗珠歌词 厨师歌词语 地球上的星星歌曲歌词意思 复眼歌词 宫锁心玉片尾曲歌词 诺澜歌词 冰雪歌词 复眼歌词 跟着风筝飞歌词 诺澜歌词 找德语歌词 冰雪歌词 10 pm歌词 周华健花旦歌词 曾经沧海周深歌词意思 宅男歌词 地球上的星星歌曲歌词意思 任贤齐太平洋歌词 冰雪歌词 命运这首歌歌词 星动力(星战版)歌词 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 齐天云帝 我俩搞点事 大小姐的末世保镖 数据代码 破晓之轮回 百度 百度 百度 百度 百度 跟着风筝飞歌词 任贤齐太平洋歌词 曾经沧海周深歌词意思 周杰伦公主病歌词 周华健花旦歌词 找德语歌词 我愿做你的依靠歌词 隐形的翅膀谱子加歌词 我愿做你的依靠歌词 哥哥不来花不开 歌词 10 pm歌词 明明说好不哭歌词完整版 我们都已经老了歌词 宅男歌词 冰雪歌词 曾经沧海周深歌词意思 诺澜歌词 周华健花旦歌词 命运这首歌歌词 山外楼高歌词 地球上的星星歌曲歌词意思 隐形的翅膀谱子加歌词 周华健花旦歌词 我们都已经老了歌词 扇子舞老干妈歌词下载 冰雪歌词 军中绿花伴奏带歌词的 烧麦的歌词 找德语歌词 烧麦的歌词 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网