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
常熟驾校教练招聘长春经开驾校常熟冶塘驾校好吗常熟冶塘驾校乱收费吗残疾人体检报名驾校常熟驾校教练招聘长安驾校邹城常熟冶塘驾校好吗长春德胜驾校的校长昌吉驾校报名费踩刹车 女司机惊险驾校常熟冶塘驾校好吗昌吉顺义驾校在哪踩刹车 女司机惊险驾校常熟冶塘驾校联系电话昌吉驾校报名费长安开元驾校招聘网苍南县驾校考题苍南县驾校考题常平冠骏安达驾校长春德胜驾校电话苍南县驾校考题长春德胜驾校的校长长春市校河南教练驾校常熟冶塘驾校是正规长春市久鼎驾校常熟冶塘驾校是正规长春市校河南教练驾校常平冠骏安达驾校昌吉顺义驾校在哪穿越你见过,穿越两次的你见过没? 好不容易穿越古代成了王莽,一出场就干死天下所有刘秀,可兢兢业业那么久,还是一朝帝王变打工! 再穿越,我服了,我躺平了,我摆烂了,我做一个普通人总行了吧? 只是这粮食不够吃,总得研制下肥料吧? 天啊,上厕所还要棍刮,奶奶的,我造纸还不行吗! 看个颜色小说还要手抄,活字印刷术搞起! 皇帝:尔有大能,可愿入宫为官? 别,我是废物,我只想做平民百姓! 一次意外,世界顶级雇佣兵穿越到异世界,成为了银龙城附近的猎人。 十几年过去,他一直以为自己穿越而来只会成为一个闲散的猎人,每天只会钓钓鱼,抓几只兔子,摘几株药材换酒钱打发时间,最大的乐趣不过是调戏邻居的小女孩。 但在他十五岁的凛冬日,村子里最强大的猎人大胡子离奇失踪,无奈之下,庭瑞只得踏入到苍茫山脉寻找大胡子的踪迹。 越过茫茫群山,踏过无数冰雪,他终于找到了大胡子在坚冰上刻下的痕迹。 但令人费解的是,上边只留下了一个潦草的“鬼”字便再无其他痕迹。 就在林庭瑞感到疑惑沉下心思思考的时候,他的身后突然响起了喀嚓喀嚓的踩雪声…… 秦晓是个普通的上班族,在家里看动漫,突然就穿越了。 “这是在哪啊喂?我看个动漫都能穿越就离谱。” 在这里,他获得了极其类似替身的东西——法外身,以及从未体会过的……亲情。 突然有一天,父母消失了,他决定要报仇,顺便拯救个世界,对,肯定是顺便。 “话说,灵魂为什么会过一会才消失?还有这天怎么越来越暗?越来越阴冷了呢?”剑士大陆发生巨大变动,斩妖除魔的无名者团队结束了日复一日的安逸生活,再度踏上了拯救各种族民众的旅途,他们会遇到什么?“呐~欢迎来到「梦世界」哦!” 伴随着一句欢迎语,我就这样被强制进入到了压根没有听说过的「梦世界」 “帮别人的话,之后我会去满足属于你们的愿望哦~ 因此我开始了「满足别人愿望」的旅程,并且一开始就是我的同班同学奚梦,再怎么说这也极其匪夷所思吧,这是什么轻小说剧情吗。 而在这之后,她也来到了这个「梦世界」 在不断变化的梦境世界中,我与她开始了一段波折且愉快并奇妙的故事。 作者:双风之影丶轻雨 封面:十里烟花_ 封林是一个在北京潘家园旧货市场开旧物店的小老板,一次在给店里的老房屋装修的机会,竟然在家里墙壁地下暗格发现一个密室,不太大的密室角落里有着一口上了锁的红色的木箱子,盒子打开后里面有着几样东西,一块巴掌大纯金的腰牌。 一本非常破旧的遁甲巫术古书, 还有着一本记录了很多秘事的明朝古书,还有一张残缺不全的地图,箱子里面藏着很多的秘密,让他知道了自己的家族竟然是一个传奇盗墓家族的后人 从古至今的家族秘密缓缓的被揭开,父亲的突然消失,也与此事有关,是为了寻找哪些传说中的东西。 自己兄弟的回归,退役特种兵赵雷,去追寻着父亲的脚步去寻找那传说中的古遗迹,不得不踏入那些恐怖之地。 入活人的禁区,与僵尸斗法,与活人斗智,有一张尸面的鬼狐仙,荒冢野坟墓里的媚女,害人的白皮千年老狸子,披着美女人皮的行尸走肉,几十年难得一见沉没在海里的幽灵鬼船。 一张残破不全的地图,一截刻满符文的龙骨,到底藏着什么秘密?   一代网文大神凌云,竟然穿越到自己的小说中了。   父亲:孩子以后这个家就靠你了。   凌云:我要断绝父子关系。   仆人:&amp;quot;少爷,您还记得您的娃娃亲吗?&amp;quot;  凌云:&amp;quot;娃娃亲,赶快退婚!快点!&amp;quot;   且看凌云如何玩转玄幻世界   努力了十年,终于经济独立了,本以为可以彻底甩手享受生活,迟来的系统却逼着他去当个门主。 既然都当门主了,那更加不用那么拘束了,谁让这个宗门这么强呢,你说对吧? 陈寻怎么也想不到,自己机缘巧合参加的一次相亲经历,竟然就此翻转了他的整个人生。楚凡获得了一个名叫主神的系统,从此开启了贸易诸天的旅程。 扛着五千万吨级的核弹和异界妖皇讲道理,真理只在核平之内! 上界十方仙帝围攻,楚凡反手掏出二向箔! 荒古圣体先天道体? 我直接提取细胞,复制上架! 什么?异界即将入侵? 我一个黑店老板,能发射智子很合理吧? 直接封锁异界天地法则,从此无人能突破大罗金仙! ...... “主神,我死后请把我的骨灰塞核弹里。” “为什么?” “身为炸天帮一员,哪怕我死了也要炸上天。” 这是一个黑店老板贸易诸天的故事,穿梭于诸天万界,和荒天帝称兄道弟,招楚子航当店内小哥! 主神出品,必属精品! 强买强卖,不服就干!
江蓠映月 一刀一剑破荒唐 神医王婿 中州生死诀 唐律凶猛 抱歉,这火我传不了 永道超然 重生之回到少年时 黑之罪 末世:求生的旅行 龙珠之重生孙悟空 九界双帝录 玩转三国:从华佗拜师开始 好闹心的游戏 漫漫修行刀剑狂 草莽也能是英雄 梦的铃叶 尘埃的城 掌运执尘 重生暗夜之王 长春久鼎驾校联系 昌吉驾校a照价格查询 长安开元驾校招聘网 残疾人体检报名驾校 长春久鼎驾校联系 长春市久鼎驾校总校 长安开元驾校招聘网 昌吉驾校价格 长春市久鼎驾校 昌吉奇台哪个驾校好 长春大学附近驾校 长春大学附近驾校 长汇驾校总校地址 昌吉驾校a照价格查询 常熟驾校教练招聘 残疾人体检报名驾校 长安开元驾校总部地址 长春市久鼎驾校 长春吉嘉驾校科二练车 常熟冶塘驾校好吗 昌吉驾校a照价格查询 常熟冶塘驾校联系电话 长春经开驾校 踩刹车 女司机惊险驾校 昌吉驾校报名费 长汇驾校总校地址 长春市久鼎驾校 长春经开驾校 长春吉嘉驾校科二练车 长春市久鼎驾校 残疾人体检报名驾校 查询驾校课时 常熟冶塘驾校乱收费吗 常熟驾校教练招聘 长春市校河南教练驾校 残疾人体检报名驾校 常熟冶塘驾校乱收费吗 长安开元驾校招聘网 长汇驾校总校地址 常熟冶塘驾校联系电话 常熟冶塘驾校是正规 昌吉奇台哪个驾校好 常熟驾校教练遭投诉 长安开元驾校总部地址 踩刹车 女司机惊险驾校 昌吉驾校a照价格查询 长春大学附近驾校 常熟冶塘驾校是正规 长汇驾校总校地址 长安驾校邹城 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 杰厉 原子打印 牧羊记 大宋王朝那些事儿 乱世枭雄曹孟德 欧博官网 亚星管理平台 澳门葡京游戏官网 皇冠登3出租 亚星官网 长春德胜驾校电话 昌吉驾校a照价格查询 长春吉嘉驾校科二练车 常熟驾校教练遭投诉 长春久鼎驾校联系 长春吉嘉驾校科二练车 常熟冶塘驾校是正规 长春经开驾校 长春市久鼎驾校总校 常熟冶塘驾校乱收费吗 长春市校河南教练驾校 长安驾校邹城 常平冠骏安达驾校 长安驾校邹城 昌吉驾校a照价格查询 长安开元驾校招聘网 常熟驾校教练招聘 长春德胜驾校的校长 常熟冶塘驾校好吗 昌吉驾校a照价格查询 常熟冶塘驾校乱收费吗 常熟冶塘驾校好吗 昌吉顺义驾校怎么走 常熟冶塘驾校联系电话 残疾人体检报名驾校 昌吉顺义驾校在哪 苍南县驾校考题 长春市久鼎驾校总校 查询驾校课时 长春市久鼎驾校总校