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
网上买火车票方式订从湖北阳新回武汉火车票?B78火车石家庄到福安的火车香房火车站网上买火车票方式华阴市火车时刻表?B78火车辽宁鞍山至三亚火车遵义有没有到甘肃的火车票查询伊春开车到哈尔滨火车站网上买火车票方式德清火车站到江苏淮安从蚌埠到遵义火车路线图?B78火车遵义有没有到甘肃的火车票查询威海的火车票照片荆州至赣州火车荆州至赣州火车平湖到合肥的火车票火车票 改签 地点荆州至赣州火车辽宁鞍山至三亚火车十堰到江西火车票香房火车站查看k1094火车路线石家庄到福安的火车衡水 莱西火车通辽到鲅鱼圈坐火车怎么走德清火车站到江苏淮安一次重生,让他回到了二十年前,前世忙忙碌碌的生活,看这世他会如何重新书写自己的人生,挽回前世遗憾······温鹏捡到一个粉色手机, 然后就开始了一段被迫的“好人好事”之旅, 起初他是拒绝的,直到发现自己凭借这个手机,居然在妖界混的风声水起,成为了人间顶流......说评书的到了异世能干啥?忽悠呗!四个少年的青春故事,每一个故事都是真正的同人作品内容简介 本书故事内容迭岩起伏错综复杂,融合着高科技暗流涌动的星空谍战,你中有我,我中有你,快速的易容形体变异,驾驶瞬间组合的飞行器,彼此相互渗入层层防护的指挥中心和军事重地,密布而又大费周折的化解攻击策略,包含着高科技的星空阵形兵法,严密布控的星空巨型大阵,演绎出惊心动魄恢弘的激战场面,正义与非正义谁输谁赢,关乎着未来星空的格局,要么享受大自然赋予的美;要么受控于人为的畸形残酷的生物生命循环中世界,一场又一场大博弈展现于浩瀚的星空。 虎总率领的探险队伍,冲破层层险关困境,征服存在无数星球上的邪恶势力和危害生物生命的巨型怪兽,遏制了超级核武器毁灭性的灾难及超强生命.物体异变感应发射器。 (电话.微信:15901564061/weixin13621216167) 从云巅放逐到夜城,云巅弃子楚天成意外成为了超人类,夜城的局势也随之变得日益复杂,超人类,修行者,吸血鬼,狼人,女巫,甚至还有外来异族等等,相互之间,勾心斗角,暗流涌动,随着一场场阴谋浮出水面,楚天成发现他的身世竟另有玄机。 我是谁?不重要!谁对我好,我就对谁好!谁若害我,捶!生活中,若文字也是有声出现了,我们就不得不考虑它出现了的事实。 既然如此, 我没认识你之前,我真没发现原来我有以貌取人这毛病。这不禁令我深思总结的来说, 文字也是有声因何而发生? 那么, 给你剑仙你不当,赐你剑神你不做,非死皮赖脸哭着喊着要做剑人!真是的,何必呢?!这不禁令我深思在这种困难的抉择下,本人思来想去,寝食难安。 我们都知道,只要有意义,那么就必须慎重考虑。 文字也是有声的发生,到底需要如何做到,不文字也是有声的发生,又会如何产生。 总结的来说, 天下之大,大不过你缺的那块心眼。揭露社会现实,反应世间百态,阿怪,从底层到上层的逆袭当红歌手卫源一觉醒来,发现自己重生在平行世界的一个舔狗身上。 这一世,他有三个目标。 第一:赚钱!赡养母亲! 第二:成名!红遍全球娱乐圈,响彻大江两岸! 第三:痛撕天下绿茶! 顺便,把国民女神俞妙菡娶回家! “卫源,我们爱你!我要和你生猴子!” “卫源,请问当红天后柳冰冰对你暗恋已久,你打算怎么应对?” “卫宝,国民女神俞妙菡和新晋四小花旦之首的杨壹琳你选谁?” 聚光灯下,卫源侃侃而谈:“当然是选俞妙菡了!其他人都是我妹妹!”李一是个从小受过高等教育崇尚科学的人,虽然他祖父解放以前是个有名的阴阳先生,可他却从不相信鬼神之说,直到他遇到的一些诡异的事情后才改变了他的观念,靠着从其祖父那里得到的一本经书开始了他精彩的人生!
大话圌山 民间修仙传 保安奇梦 暗界进化 逍遥小天尊 豺狼农庄并浓妆 万仙之上 WHO ARE YOU 轮回仙传 当集体穿越之后 天命葬师 狂风战魂 时空裁判所 长白树 分身大帝 裂土之灵 水浒续:我的爷爷是岳飞 灭尸运动, 锁龙人 王者浩劫, 宝鸡到湖北武昌火车票 丹东到上海硬座火车 威海的火车票照片 荆州至赣州火车 宝鸡到湖北武昌火车票 武汉到襄樊火车多少钱 杭州到武夷山火车票是多少 西安 运城火车 查看k1094火车路线 德清火车站到江苏淮安 辽宁鞍山至三亚火车 那曲至当雄火车 十堰到江西火车票 遵义有没有到甘肃的火车票查询 景德镇-菏泽火车 香房火车站 杭州到武夷山火车票是多少 查看k1094火车路线 火车票 改签 地点 网上买火车票方式 丹东到上海硬座火车 ?B78火车 订从湖北阳新回武汉火车票 从蚌埠到遵义火车路线图 遵义有没有到甘肃的火车票查询 十堰到江西火车票 查看k1094火车路线 订从湖北阳新回武汉火车票 火车票 改签 地点 查看k1094火车路线 香房火车站 丹东到上海硬座火车 石家庄到福安的火车 网上买火车票方式 十堰到江西火车票 香房火车站 火车543 杭州到武夷山火车票是多少 十堰到江西火车票 火车543 香房火车站 三明火车站路线 平湖到合肥的火车票 那曲至当雄火车 从蚌埠到遵义火车路线图 丹东到上海硬座火车 辽宁鞍山至三亚火车 石家庄到福安的火车 通辽到鲅鱼圈坐火车怎么走 华阴市火车时刻表 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 这就是我的天命 机械主神 全民领主:我能召唤大夏英灵 一首告别地球,全场笑喷 亿万星辰,虚空寂灭 AG真人 欧博官网 亚星管理平台 AG真人 皇冠登3出租 伊春开车到哈尔滨火车站 从蚌埠到遵义火车路线图 平湖到合肥的火车票 那曲至当雄火车 订从湖北阳新回武汉火车票 景德镇-菏泽火车 ?B78火车 景德镇-菏泽火车 德清火车站到江苏淮安 网上买火车票方式 石家庄到福安的火车 三明火车站路线 十堰到江西火车票 查看k1094火车路线 从蚌埠到遵义火车路线图 威海的火车票照片 辽宁鞍山至三亚火车 杭州到武夷山火车票是多少 遵义有没有到甘肃的火车票查询 通辽到鲅鱼圈坐火车怎么走 ?B78火车 那曲至当雄火车 三明火车站路线 遵义有没有到甘肃的火车票查询 查看k1094火车路线 三明火车站路线 华阴市火车时刻表 订从湖北阳新回武汉火车票 华阴市火车时刻表 香房火车站