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
宣威保山派出所电话承德围场租车电话贵阳金阳客车 售票电话胶南至临沂汽车电话顺联广场地址电话宣威保山派出所电话重庆瀚文酒店前台电话贵阳金阳客车 售票电话合喜味道订餐电话济南到长沙火车票查询电话雅客空间房地产电话贵阳金阳客车 售票电话润满多会所番禺店电话晋宁客运站 电话滨江区可莎蜜儿电话济南到长沙火车票查询电话保利机场大巴订票电话东丰如家电话号码东丰如家电话号码天?h商务酒店电话太原到枣庄高铁时刻表查询电话东丰如家电话号码合喜味道订餐电话江宁就业管理中心电话顺联广场地址电话潜山县皖城超市电话盘锦站电话号码是多少江宁就业管理中心电话天?h商务酒店电话润满多会所番禺店电话父母神秘失踪,只留下四样东西: 1封信、1万块钱、1个扳指,1瓶老酒。 “小烨:18岁前,不许喝酒,不许找我们。” 今晚过后,苏烨就满18岁了。 喝不喝那瓶酒呢? 喝了之后将会发生什么? 这是苏烨面临的两个问题!平行世界的夏国,娱乐产业空前繁荣。 女团、综艺,脱口秀、西洋乐器,几乎掠夺了观众的所有目光。 明星宗洋媚外,以会唱外文歌沾沾自喜,以能和外国明星合作为荣。 蓝湛,就重生到了这样一个乌烟瘴气的世界。 因为无知,所以抵触。这世界,令人心寒。 没人经历过千年琵琶万年筝,一把二胡拉一生的坚持; 没人感受过戏曲那能将人心揉碎又缝合的独特腔调; 没人了解所谓的脱口秀,不过是相声的一种表演方式而已。 一曲二泉映月,一场霸王别姬。 蓝湛要让人明白,不论是艺术,还是取悦观众,国风国粹都是祖师爷!煮夫是个大纲废、取名废、简介废,但是唯独文笔和构思不废,喜欢看不一样的故事就请看我的书吧,本来起纲的时候是都市纪实向或者恐怖灵异向的,结果,结果因为很多东西太敏感不能写,一不小心就涉黄涉政涉黑涉毒了,所以就只能改了,以下是我坦白的内容: 这个故事呢,大体是一个叫石羽白的“年轻人”带着自己送上门的老婆孟婆神“孟芝兰”别样的强者归来之路,也没写什么大事儿,就是破个九煞改命局、破个擒天锁地阵、再盗个太古神墓啥的,顺手暴锤一下巡天夜叉王,破解了先天十六卦之谜这种小事都不值得一提了。姜子牙离世之后,打神鞭和道法之意,让他流于后人,世上一并妖魔也随着天道封神之后隐秘下来,纷纷融入凡间,混迹在人类之中生存。 而世间时间推移百年千年,在人世之中隐藏自己的身份,而道法和这些妖魔鬼怪都也被世人作为饭后闲谈而已,当作故事流传至今。 而姜子牙的后人也就是道法继承者,在千年里还是和妖魔进行抗争,在不被世人所知的情况下斩杀驱除于世。 直到【中历】黄帝纪年4695年,也就是现代的公元2004年,公历闰年,科技发达,世人也都认为妖魔只是那些歪理邪说诡异故事。 “你信神么?”。 “不信就跟我走吧”。一户人家二百年的风风雨雨满堂花醉三千客,一剑霜寒十四州。 觉醒了【无上剑心】的落魄皇子段宗成为了天山剑派的观剑弟子,手握灵剑,他能看到剑中蕴藏着的人生大道。 手持千万灵剑,掌握千万剑意。 【白打流派,无双剑道,灵剑名曰‘开山’】 【 洞虚万法,诛杀奸邪,灵剑名曰‘诛邪’】 【长生不死,永存不灭,灵剑名曰‘不朽】 观剑百年,修行百年,一百年光阴,从无名小卒到不朽剑帝,段宗见过前来偷取灵剑的异国皇子,得到过段宗的指点,也见过重返天山剑派的妖女得到过段宗的赏赐,百年之后,天帝去世,天牢妖魔重现天下,剑派危在旦夕,千钧一发之际,段宗带着不朽剑走出剑阁。 “本帝在此,狼狈为奸者,谋权篡位者,倒行逆施者,妖言惑众者,都要死!” 当低魔时代遭遇天灾人祸,当混沌神选开始觊觎这个世界,当旧日支配者降临世间,当泰伦虫族迷路至此,当遭受欲望的驱使互相征伐内斗,人类究竟可以坚持多久? 在末世的大框架下,人性的黑暗面暴露无遗,但勇气的赞歌也可以响彻云霄。 一双眼睛,看不清世态炎凉。 一壶浊酒,饮不尽爱恨情仇。 一张笨嘴,道不完沧海桑田。 一曲高歌,唱不清岁月蹉跎。 一段故事,只不过黄粱一梦。 本书所有主人公只是随着事件的推动而依自己的性格进行。他们只是这段历史的见证者,经历者 ,仅此而已。 万物轮回始于本末,功过是非,皆留各位看官评说。 本作不回会去影射现实生活,如有巧合实属雷同。 毕竟历史总是惊人的相似,我们只是历史的见证者。 为了逃婚,他随便找了个美女合租,不料她竟是自己未见过面的未婚妻。 为了赚钱,他信手炼制了几枚丹药,不料竟做成了天下第一的医药公司。 为了修行,他顺手收了几个女徒弟,不料她们竟都有着惊世骇俗的身份。 为了救人,他甘愿自废一生之修为,不料所救之人竟是艳绝天下的女帝。 为了复仇,他勤修苦练至大功告成,不料最大的魔头之主竟是……李天命做梦都要笑醒了。他家的宠物,竟然都是传说中的太古混沌巨兽! 他的家鸡,是以太阳为食的‘永恒炼狱凤凰’。 他的黑猫,是以雷霆炼化万界的‘太初混沌雷魔’。 连他家的小强,都是拥有万亿不死分身的‘万界永生兽’…… 从此,他驾驭十头太古混沌巨兽,化身万古第一混沌神灵,周游诸天万界,镇守无尽神域。万物魔灵,诸天邪魔,连爬带滚,哀呼颤抖! 是乱世出英雄?还是英雄造就乱世?
世侍弑尸史 魁巫转 逆道斩神 入侵:垢 全球末日:庇护所无限升级 神谕末日 大宋萧魔王 超神御兽师 九阙之歌 卡米斯大陆编年史 九星荒天诀 末世召唤2 金言在上 大起大落的鬼畜人生 纵星者 我竟然穿成女元帅 龙珠:开局加入聊天群 夜将起 此处明日 离婚后,成了天后的私人男助理 深圳公明公安局电话号码 烟台福山医院门诊电话号码 保利机场大巴订票电话 顺联广场地址电话 深圳公明公安局电话号码 万达宝贝王电话 保利机场大巴订票电话 延吉航空学院电话 潜山县皖城超市电话 松岗万华酒店ktv电话 合喜味道订餐电话 云浮长洲酒店电话 黄岛开发区公证处电话 烟台福山医院门诊电话号码 宣威保山派出所电话 顺联广场地址电话 博美酒店联系电话 潜山县皖城超市电话 新会财记快餐电话号码 贵阳金阳客车 售票电话 烟台福山医院门诊电话号码 滨江区可莎蜜儿电话 承德围场租车电话 晋宁客运站 电话 济南到长沙火车票查询电话 黄岛开发区公证处电话 潜山县皖城超市电话 承德围场租车电话 新会财记快餐电话号码 潜山县皖城超市电话 顺联广场地址电话 雅客空间房地产电话 胶南至临沂汽车电话 宣威保山派出所电话 江宁就业管理中心电话 顺联广场地址电话 胶南至临沂汽车电话 保利机场大巴订票电话 黄岛开发区公证处电话 滨江区可莎蜜儿电话 盘锦站电话号码是多少 松岗万华酒店ktv电话 台北纯k订座电话 博美酒店联系电话 晋宁客运站 电话 烟台福山医院门诊电话号码 云浮长洲酒店电话 盘锦站电话号码是多少 黄岛开发区公证处电话 重庆瀚文酒店前台电话 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 路人系统之命运重生 穿越后死宅被迫震惊全世界 沉楼 异世成就至高 我在绝地求生杀敌成神 万利游戏官网 欧博游戏官网 欧博官网 亚星官网 AG真人 万达宝贝王电话 宣威保山派出所电话 延吉航空学院电话 博美酒店联系电话 东丰如家电话号码 润满多会所番禺店电话 胶南至临沂汽车电话 合喜味道订餐电话 济南到长沙火车票查询电话 江宁就业管理中心电话 江宁就业管理中心电话 太原到枣庄高铁时刻表查询电话 新会财记快餐电话号码 保利机场大巴订票电话 云浮长洲酒店电话 昌平如家电话 潜山县皖城超市电话 台北纯k订座电话 济南到长沙火车票查询电话 保利机场大巴订票电话 天?h商务酒店电话 松岗万华酒店ktv电话 胶南至临沂汽车电话 云浮长洲酒店电话 烟台福山医院门诊电话号码 万达宝贝王电话 万达宝贝王电话 松岗万华酒店ktv电话 松岗万华酒店ktv电话 雅客空间房地产电话