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
昔阳客运站电话多少建行朝阳北路支行电话龙岩到宁化汽车电话号码虎门轮渡停航电话宜昌平湖交警大队电话昔阳客运站电话多少贵州喀斯特酒店电话龙岩到宁化汽车电话号码清远飞来寺电话海门咖语宿 电话怀化黑车电话龙岩到宁化汽车电话号码安丘市八旗羊肉电话怀化黑车电话虎门货轮渡收费站电话海门咖语宿 电话酒店电话客服招聘信息中国银联客户服务电话宜昌平湖交警大队电话林甸盛源火锅电话滨江浦沿交警电话中国银联客户服务电话清远飞来寺电话资中北站 电话孟州太极拳馆电话大连前关派出所电话号码孟州太极拳馆电话吴良材眼镜店电话林甸盛源火锅电话胶南路居委会电话人生的意义是什么? 笔者人处中年,有很多事和人掺杂着许许多多的片段,不时的出现在脑海中。可能是一个画面、可能是一首歌、又或许是一张熟悉又陌生的面孔。 记得北洼坑里活着泥的宏伟,小飞;苹果树园子里被大人追着跑的茂恒,国夺;骑车子去四庄上学的伙伴;爬墙头被主任抓的蓝猫,黑强;初中和临班打架时的冲动;高中一起打篮球的队友;辍学后自己当老板时候的胡闹;预科大学五排开黑的欢乐时光;结婚时候的无奈与开心;进场蹭模具的996生活;初出茅庐后差点下线的事故;孩子降生后的生活日常;父母的离异;孩子的自闭症生活;白天上班晚上兼职的无奈;亲身经历自杀的绝望;家人的离世;再创业时候的艰辛;苦尽甘来的艰难与美好;等等······· 这些只是我人生的一部分,我想留下这些“美好”,也不旺我来这嘈杂的世间走一趟。 人生的意义是什么? 与我看来,就是这些文字能被后人看到,有所启发;也想给我的孩子,留下他父亲的平凡和伟大。 ---蛆先生曾经他傻了五年,遭同村人排挤。 一朝清醒,他偶然获得医药传承。 难得一见的千年人参,他随手即可培育,从此开启了妖孽人生…… 医术渡人,丹药惊世! 他玩转都市,最终却选择归隐乡野,成为全网膜拜的隐世药圣!妹妹得来癌症,杨涛不得不从事扒手职业,但是在一场意外之中,杨涛被神秘的光球带去了七千年后,杨涛在七千年的地球,了解到了自己离开后地球上的变化,觉得很是愕然于震惊。但是考虑到自己离开后,没人照顾的妹妹,杨涛下定决心要回去,觉得既然光球能带自己到这里,同样,自己也能依靠着光球回去。杨涛在七千年后的时空,发现了自己不怕攻击,并且还能化他人的能量为己用,就这样,杨涛从弱小成为全宇宙的主宰,并利用自己的力量回到家最初与妹妹的时空.........重生异世的兵王靠自己的智慧与实力快速成长,在那风云诡谲的大陆中引领乾坤,现代的中华文化与异界文化的碰撞将会极其怎样的火花,大陆的合并又会带来怎样的疯狼,十方能人,各领风骚!亦木墟历练归来时见到家族覆灭,发誓欲要血刃仇敌,报其家恨。 闯秘境,夺至宝,守边疆,战万族。 沧海一粟,修行千秋,蝼蚁尚且贪命,诸天生灵皆在争渡。 一颗黑球可炸山镇海,一杆长枪可斩万千神明。 是非对错唯有强者定义,弱者只配臣服。 武道九重,上为天地境。 当末法时代结束,修行元气重归上古。 整个修士界,皆因亦木墟的一颗轰天雷,即将暴走...【系统+无女主+穿越】(萌新作者,文笔不好勿喷) 刘铭死了,但又没完全死。准确的说,他,跟随潮流一起穿越了。穿到了一个名为哈利波特的魔法世界,而他生前就是一个哈迷。 但这个哈利波特世界跟jk罗琳写的哈利波特有所出入。比如,这个世界并没有黑魔王,詹姆和莉莉也好好的活着,哈利·波特还多了个双胞胎哥哥。 而刘铭穿成了哈利的双胞胎哥哥伊雷·波特,当然作为穿越众中的一人,金手指也是必不可少。所以当他穿越到这个世界一年后。他得到了一个名叫霍格沃茨最强抽卡的系统。 【恭喜抽到传说卡:黑魔法精通】 【恭喜抽到传说卡:我蓝超多】 【恭喜抽到技能点】 【恭喜抽到传说卡:变异蜷翼魔】 …… 伊雷无奈的摊了摊手“没办法,太欧了”关于网游世界中的竞技,争霸,情感的故事。本书正文部分已经完成,总字数106万,情节完整。千年之前,魔君龙尘因白绍灸的叛变,再加上圣魔之乱,他腹背受敌,重伤逃至极地,暗下寻找他的爱人--绝雪,殊不知,她已身中曼陀罗花毒,忘记了他。龙尘踏着暗亚方舟,寻遍七山五岳,可依旧还是一点下落都没有,心灰意冷的龙尘毅然决定魂魄离体,因为只有这样,他才能实现长生,也只有这样,才能找到绝雪…… 其实,魔都兵变时,龙尘曾向他的挚友圣寒发过求救,圣寒接到信后,立刻带着一万精兵从星灵岛出发,援助龙尘,但他们还是晚了一步,当他们赶过去时,龙尘早已不知下落。此后,圣寒始终觉得是自己害了龙尘,所以,他毅然决定触碰灵龙魂第二天赋属性--时间,但,他失败了,神魂陨落,身体化作星光,不复存在,但即使是如此,圣寒还是凭借着强大的精神力,稳住了一丝神识…… 千年之后,龙尘与绝雪的孩子顺着极地的河流,辗转尘世十余载,身体因为受到极寒之冰的影响,依旧是孩童模样,后来,被圣承霄和苏希瞳二人收养,从此开启了属于他的人生……[风语有经年]是集散文、美文、短篇、诗词、短小说等为一体的抒怀作品,值得文学爱好者欣赏。倒霉蛋李悠然被陨石砸中,竟然被超高智能机械生命寄生,穿越到了陌生的异世界。在这个剑与魔法的世界,李悠然又是如何用机械科技走出一条康庄大道?
武纵天途 清除 关中有刀王 秦岭诡事之侍灵师 我在诡异世界修武道 三国:认贼作父,我比吕布还猛 哀伤战记 一剑陨星 绑定系统,然后它溜了 第三个日夜 重生之咪咪再续前缘 逍遥村医 制霸热搜榜 武道之路漫漫 西游:这条龙有点不一样 我靠读书称霸诸子百家 全民皆战:只有我疯狂送礼 冒险者的故事 躺平的修仙之路 元宇宙管理局 大连前关派出所电话号码 威海火车站的电话是多少钱 大同到太原大巴电话~ 宜昌平湖交警大队电话 建行朝阳北路支行电话 吴良材眼镜店电话 大同到太原大巴电话~ 呼和浩特南站电话号码 大连路唐宫电话 安丘市八旗羊肉电话 萍乡佐罗网咖电话 萍乡佐罗网咖电话 资中北站 电话 威海火车站的电话是多少钱 昔阳客运站电话多少 宜昌平湖交警大队电话 谁有丰县到商丘电话 大连前关派出所电话号码 芜湖大白鲸海洋馆电话 龙岩到宁化汽车电话号码 威海火车站的电话是多少钱 龙岩到宁化汽车电话号码 芜湖大白鲸海洋馆电话 中国银联客户服务电话 海门咖语宿 电话 北京651调度室电话 大连前关派出所电话号码 芜湖大白鲸海洋馆电话 芜湖大白鲸海洋馆电话 大连路唐宫电话 宜昌平湖交警大队电话 570路公交车电话 虎门轮渡停航电话 昔阳客运站电话多少 资中北站 电话 孟州太极拳馆电话 虎门轮渡停航电话 大同到太原大巴电话~ 资中北站 电话 虎门货轮渡收费站电话 孟州太极拳馆电话 呼和浩特南站电话号码 林甸盛源火锅电话 谁有丰县到商丘电话 怀化黑车电话 570路公交车电话 萍乡佐罗网咖电话 孟州太极拳馆电话 北京651调度室电话 酒店电话客服招聘信息 亚星官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 师兄们上山了 飘浮于短暂清醒之上的城市 人类实是动物 我在末世的苦日子 19特区 欧博官网 亚星官网 万利游戏官网 欧博官网 澳门葡京游戏官网 大同到太原大巴电话~ 芜湖大白鲸海洋馆电话 虎门货轮渡收费站电话 570路公交车电话 林甸盛源火锅电话 孟州太极拳馆电话 大连路唐宫电话 海门咖语宿 电话 龙岩到宁化汽车电话号码 谁有丰县到商丘电话 谁有丰县到商丘电话 呼和浩特南站电话号码 安丘市八旗羊肉电话 570路公交车电话 威海火车站的电话是多少钱 宜昌平湖交警大队电话 酒店电话客服招聘信息 滨江浦沿交警电话 龙岩到宁化汽车电话号码 怀化黑车电话 清远飞来寺电话 虎门轮渡停航电话 大连路唐宫电话 威海火车站的电话是多少钱 昔阳客运站电话多少 大同到太原大巴电话~ 大同到太原大巴电话~ 虎门轮渡停航电话 虎门轮渡停航电话 即墨郭家巷卫生所电话