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
香港讲鬼电视剧电视剧墨渊剧照西安枪案电视剧电视剧里的黑色老爷车电视剧里有陈建军香港讲鬼电视剧朴叙俊 电视剧西安枪案电视剧抗日电视剧铁血忠魂河神电视剧恐怖镜头梅花扇电视剧香港讲鬼电视剧新萧十一郎的电视剧全集在线观看电视剧杨紫 还没上映西安枪案电视剧河神电视剧恐怖镜头内地枪战片电视剧电视剧林海雪原最新版电视剧林海雪原最新版重耳传电视剧剧照电视剧里的尹雪电视剧林海雪原最新版抗日电视剧铁血忠魂有色诱古装电视剧电视剧里有陈建军2016黄日华新电视剧电视剧里的黑色老爷车陈楚洹主演电视剧深夜食堂2电视剧下载新萧十一郎的电视剧全集在线观看道生一,一生二,二生三,三生万物。万物负阴而抱阳。 何为道,道可道,非常道。天地秘法,万物玄宗。 何为道心,天地不仁,以万物为刍狗,圣人不仁,以百姓为刍狗。天地之间,其犹橐籥乎 一颗道心吸引了万千修道之人,只为追求天地最初的答案 且看小道士曲折离奇路,探寻道心何处 本书依据本人真实事件改编,你可不信,不可不敬 文章多处为改编后所撰写,莫要模仿一开始,穿成假太监的李易只想安分苟活着,但后来,看着高贵雍容的皇后,李易心思变了。 “江山你坐着,皇后我替你照顾。” 李易都跟皇帝打好了商量,奈何那把椅子,皇帝就是坐不稳啊! 前有狼,后有虎,奸臣又一堆堆,眼看国不国,家不家的,李易操起了屠刀…… 一块不起眼的石头,内里竟然容纳一方世界。少年只是随手一捡,便是陷入沉睡。 十年一梦,梦里十万年。 醒来,家族没落,承受着家族的血脉诅咒,他能否逆天改命。一曲长歌动天下 一剑光寒十九州 救苍生,斩邪魔 宋鸾不负天下人什么是江湖?江湖便是人心,人心恶,江湖险。江湖风气云涌,邪恶势力盘根错节蓄势待发,墨家机关术再现江湖,是正是邪?活人炼僵尸,野兽军团汹涌来袭。八臂观音走下神坛,海底神功刀枪不如倭寇大军更要如何抵挡?一把来历不明的纯钧名剑,一处富可敌国的稀世宝藏,一场身不由己的家国恩怨。更有儿女情长,爱恨纠葛,他该如何面对? 他们说,如果做了神仙就好了,因为那样可以无忧无虑的,真的吗?   天蓬,你喜欢现在的生活吗?整天活在生死之中!   喜欢……是什么意思?   天蓬,你知道自己犯了什么罪吗?   知道,因我爱上了我所爱的人!   贬你入凡,散你修为,可服?   我……   我虽然是头猪,但我,不,任,你,们,宰!   为什么要骗我?为什么?   因为你傻啊!   大圣,此去欲何?   踏南天,碎凌霄   若一去不回……   便一去一回!   天蓬,我们终不能改变那个开始,何不忘了那个结局?   负尽千重罪,炼就不死心   现在我明白了,说我调戏仙娥,犯下天条,贬下凡尘,散我修为,要我了去凡心,我!不!服!   说俺大闹天宫,妖性大发,顽心不改,困我百年,要我戴上紧箍,像条狗一样顺从你们,我!不!服!   卷帘,当神仙痛快还是这闹天宫痛快?   三藏,倘若俺老孙一去不回,待到来生再吃你的肉! 生我何用?不能欢笑,灭我何用?不减狂骄。 这个天地,我来过,我奋战过,我深爱过,我,不在乎这结局!                        讲述一些恐怖的,悬疑的故事,(人物名并不是真的,如有冒犯请见谅)“林诺,我不会放过你的。” “珍惜你的所拥有的时间吧,毕竟你拥有的时间可是不多了哦。” “不要走。” “你好,我叫星辰,星辰大海的星辰。”(一笑) “她是谁?我。。不记得了。” “这个世界,,不存在?” “我叫林诺,是一名高中生。。。” “前辈,让我们一起来玩游戏吧,哎嘿嘿……”天下武林起纷争,江湖儿女几多情。 家仇国恨风云起,刀光剑影始无终。 双龙剑中觅宝藏,群雄逐鹿亦为功。 天一巫祝几时恨,恩怨消散转头空。武神,是所有人都想达到修为高度,成为武神,便可傲视整个世界。但云飞所处的那一片大陆因一场前所未有的大战倒退了不知多少年,为了打破禁锢,他带领伙伴们毅然踏上那条虚无缥缈的成神之路,去寻找大陆传说中的神器,却发现一个巨大的阴谋。那个让世界陷入绝境,让人恐惧胆颤的女人即将重回大陆,她的名字让所有人为之颤抖,她是那个站在武神之巅的人,拥有大陆最强武器,一招便可灭世,出现即是末日,而一切都压在了他的身上..
异界,从当城主开始! 都市:钱太多花不完怎么办 制霸热搜榜 超级智能修仙系统 魔神鬼卿 一品布衣 边镇刀声 罪恶城下星净土 织网者,复仇 最后一个捉鬼道士 我们的神族 大周小王爷 Fate:DragonVeinWar 伪神与混沌末日 了不起的都市修仙模拟器 神魔创 王者梦庄周 众神们的日常生活 异冰武法士 郭嗷嗷脑洞随记 电视剧人民的公仆 电视剧谍战片神秘女谍 内地枪战片电视剧 电视剧林海雪原最新版 电视剧人民的公仆 咱们相爱吧电视剧评分 女王类型电视剧 杜江个人资料的电视剧 2016黄日华新电视剧 新萧十一郎的电视剧全集在线观看 抗日电视剧铁血忠魂 战昆仑电视剧第15集 有色诱古装电视剧 河神电视剧恐怖镜头 台湾电视剧一点红 电视剧里有陈建军 女王类型电视剧 2016黄日华新电视剧 电视剧里的尹雪 香港讲鬼电视剧 电视剧谍战片神秘女谍 西安枪案电视剧 电视剧墨渊剧照 电视剧杨紫 还没上映 河神电视剧恐怖镜头 有色诱古装电视剧 2016黄日华新电视剧 电视剧墨渊剧照 电视剧里的尹雪 2016黄日华新电视剧 电视剧里有陈建军 电视剧谍战片神秘女谍 电视剧里的黑色老爷车 香港讲鬼电视剧 有色诱古装电视剧 电视剧里有陈建军 电视剧 非常突然 女王类型电视剧 有色诱古装电视剧 电视剧 非常突然 电视剧里有陈建军 大刀电视剧王营长 重耳传电视剧剧照 战昆仑电视剧第15集 电视剧杨紫 还没上映 电视剧谍战片神秘女谍 抗日电视剧铁血忠魂 电视剧里的黑色老爷车 深夜食堂2电视剧下载 朴叙俊 电视剧 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 凶宅诡事 我只是喜欢钱 系统之我在NBA叱咤赛场 一觉睡到天亮 尸语者日记 快连下载 亚星管理平台 亚星游戏官网 快连下载 百家乐官网 台湾电视剧一点红 重耳传电视剧剧照 电视剧里的尹雪 河神电视剧恐怖镜头 贤妻良母09 电视剧 台湾电视剧一点红 2016黄日华新电视剧 电视剧墨渊剧照 电视剧林海雪原最新版 电视剧人民的公仆 有色诱古装电视剧 电视剧里的黑色老爷车 有色诱古装电视剧 内地枪战片电视剧 重耳传电视剧剧照 梅花扇电视剧 杜江个人资料的电视剧 梅花扇电视剧 台湾电视剧一点红 战昆仑电视剧第15集 台湾电视剧一点红 电视剧谍战片神秘女谍 西安枪案电视剧 台湾电视剧一点红 贤妻良母09 电视剧 西安枪案电视剧 电视剧里有陈建军 新萧十一郎的电视剧全集在线观看 电视剧林海雪原最新版 咱们相爱吧电视剧评分