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
执迷的歌词告白之歌歌词卷珠帘是哪里的歌词北京爱情故事插曲歌词本兮的纪念歌词执迷的歌词歌词里一世我为卷珠帘是哪里的歌词春天来了的英文歌词小夜曲关牧村歌词薛之谦歌曲歌词串烧卷珠帘是哪里的歌词歌词蓝精灵薛之谦歌曲歌词串烧无奈与不舍歌词小夜曲关牧村歌词歌词你住在我心里那个人同手歌词同手歌词红燕歌词来不及再见 林采欣歌词同手歌词春天来了的英文歌词月半弯 张学友歌词谐音公演歌词横闯直撞歌词公演歌词月半弯 张学友歌词谐音红燕歌词歌词蓝精灵她宇文曼——大夏国第一个女皇帝。 坐上龙椅的第一天起,她就成为了不折不扣的傀儡。 本来想着就这样混吃等死,结果突然的一场兵变,连傀儡都做不成了...... 当她再一次夺回皇位时,世人对她依然缺乏认同。 在这个群雄争霸的年代,最弱的女皇,居然在所有人眼皮底下捡了个大便宜。 如果治理这个天下能算作便宜的话... 断壁残垣、饿殍满地、民不聊生... 战争带来了至高皇权,也带来了遍地枯骨。 宇文曼正襟危坐,身边是刚刚被册封的“国姓爷”文泰,殿外站着忠心耿耿、整齐成排的士兵,台阶下是一群诚惶诚恐的大臣。 大臣们曾经跪拜过她,又肆意污蔑她...如今为了日子过得去,只好颤颤巍巍的再次向女皇磕头。 好在女皇的心思还不在他们身上。 因为她是皇帝,所以没有退路——进则生,退必死! 奇迹不会一次又一次发生! 她必须整顿纲纪。 必须让难民归乡、让荒废的良田重新长出庄稼。 必须挥舞利剑,赶走那些盘踞中原的豺狼虎豹......与地球极为相像的平行世界—地星,各个国公司均爆发了生化危机。 无药可解的致命病毒席卷全球,末日降临,“感染者”横行无忌, 杨小海,父母双亡,一无所长,唯一可夸赞之处,便是资深宅男一枚。 赖床的一个早上,梦中巨响彻底改变了命运的轨迹。 别人对致命感染避之唯恐不及,他却混的如鱼得水; 出门打水捡个怪人后,他的世界彻底乱了……傍晚意外身死,重回今天早上。 意外获得能力,冷漠暴打怪异。 看羽生晴如何养妹妹,斗妖怪,一步步成就最强。 ps:本书暂时又名《我的同学是妖怪》,《我的同学是病娇》。男主明子皓是一位刚刚毕业的大学生,刚刚打算步入社会的他在一次偶然的机遇下他发现了不为人知的秘密,他的人生从此发生了翻天覆地的变化……抬步纵横十万里,眺目远望百万天,黑衣染血无踪痕,幽凉悲笑讽苍天。 以尸恶名行义事,横眉冷视万夫狂,待回首,从头走,真假是非纵天行。 星冢,为古往今来历代大能之安息之地,于九霄之上,护众生之安。 百年前,初神降临,血战再起,各方大能争夺“黑石”,造成北方天穹星冢俱毁。 历史的目光被拉回了初古那段黑暗时代,一张墨玉面具,成为了再一次反抗的标志……陈家是东北一个普通的农村家庭,改革开放前生活困苦,看不到希望,后乘着改革开放的春风,陈家生活逐渐富足,一家人也收获了爱情和幸福生活,富裕后的陈家人开始想着帮助相亲致富,在遭遇挫折之后,陈家新一代掌舵人开始更大的计划,想改变他所生活并热爱的那片黑土地!大家好我是世家独一,阴阳界这部作品是我写的一本小说,由于时间比较富裕,现在语音播讲也是我自己在播,阴阳卷一共十二卷,这部叫阴阳界之仇仙。 简介 阴阳界,一个存在即是合理的地方,因为城隍力量薄弱,强大的阴魂精怪建立的狂欢乐园,横死之人死后会不由自主的被阴阳界吸引,这里就是精怪阴魂的游乐场。风水法器世家岳家长孙岳清山,阴阳杂家吕齐官(地府五官王转世),虎(护)族修罗兄弟(异卵双生),净土宗大尊关门弟子明觉行者(净土宗世间行走),五人组成玄学天团,闯荡阴阳界,梳理华夏龙脉,一扫阴阳界混乱。 (阴阳界首卷,也是起始卷,名字“仇仙”) ps:每天一章,不会多更,如无意外阴阳界600万字起,终生系列,每卷单发单本。 书友群号:阴阳界之仇仙 76922085全球苏醒,灵气复苏二十年前,他被一代道门隐脉奇人所救。二十年后,他遵守师父遗命下山踏入何家,阴差阳错之下成为何家的女婿,内心从抗拒到默默守护,皆因那一纸婚约而起!光锥之内皆是命运,光锥之外皆是虚无。 光锥探索者 卢梭沉默道 当光锥交错时,命运之弦已然波动,世界之弦不断交错,蔓延。 命运编织者 翻花绳大师 许庭低语道。 世界毁灭时,最后的挽歌将信息送到过去,这是末世的回响,而接受了回响者的使命就是避免这毁灭的到来。 回响者卞林如是说 天灾来临,启示已显,我等唯有逆流而上。 天灾启示者 苏弦瑜言
网客行动 末世之神级暗影系统 唐律凶猛 大飞探案记 冰火山河 星辰夜雨 风楴夜 一剑凌尘西边来 史上最强创业系统 萨伽索之隐秘真相 撼昆仑 刻面晴空 灵气时代,我能复制武魂 大秦:千古一帝,从道祖开始! 医圣下山:开局打脸未婚妻! 三千界之屠龙令 绝世无敌杀神 剑域:万界提取系统 原神浩劫之成神之旅 白虎堂二三事 背靠背歌词 乌拉多恩刀歌词 歌词你住在我心里那个人 本兮的纪念歌词 背靠背歌词 拼搏人生歌词 歌词你住在我心里那个人 民歌歌词。 横闯直撞歌词 歌词to be lonely 相爱到永久的歌词 相爱到永久的歌词 #NAME? 乌拉多恩刀歌词 执迷的歌词 本兮的纪念歌词 普通disco西瓜jun歌词 横闯直撞歌词 雨花夜歌词 卷珠帘是哪里的歌词 乌拉多恩刀歌词 无奈与不舍歌词 告白之歌歌词 薛之谦歌曲歌词串烧 小夜曲关牧村歌词 #NAME? 横闯直撞歌词 告白之歌歌词 雨花夜歌词 横闯直撞歌词 本兮的纪念歌词 歌词 叶叶 北京爱情故事插曲歌词 执迷的歌词 月半弯 张学友歌词谐音 本兮的纪念歌词 北京爱情故事插曲歌词 歌词你住在我心里那个人 #NAME? 无奈与不舍歌词 公演歌词 歌词to be lonely 甲方乙方韩磊歌词 普通disco西瓜jun歌词 薛之谦歌曲歌词串烧 歌词 叶叶 相爱到永久的歌词 公演歌词 #NAME? 歌词里一世我为 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 道术不是黑魔法 时空错乱之身世谜团 碧血云天 全球震惊!你管这叫普通男人? 弈心启示录 亚星管理平台 澳门葡京官网 葡京官网 亚星管理平台 万利游戏官网 感恩的歌歌词、 民歌歌词。 北京爱情故事插曲歌词 告白之歌歌词 月半弯 张学友歌词谐音 公演歌词 同手歌词 公演歌词 普通disco西瓜jun歌词 本兮的纪念歌词 歌词 叶叶 歌词你住在我心里那个人 卷珠帘是哪里的歌词 红燕歌词 民歌歌词。 来不及再见 林采欣歌词 背靠背歌词 雨花夜歌词 感恩的歌歌词、 无奈与不舍歌词 同手歌词 告白之歌歌词 歌词你住在我心里那个人 感恩的歌歌词、 红燕歌词 歌词你住在我心里那个人 春天来了的英文歌词 月半弯 张学友歌词谐音 春天来了的英文歌词 乌拉多恩刀歌词