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
新南征北战电影完整版兄弟的朋友电影下载新言情时代 电影小火车 电视电影笑傲江湖任贤齐版电影新南征北战电影完整版许绍雄最新电影新言情时代 电影凶魅 电影下载向华强主演的电影邪电影百度云新言情时代 电影驯龙高手1电影免费粤邪电影百度云信仰的阴谋电影好看吗向华强主演的电影许志安电影 警察邪 电影下载笑傲江湖任贤齐版电影新的鬼片中国电影兄弟的女人 电影在线邪 电影下载凶魅 电影下载新出鬼片中国电影校花贴身高手电影新出的美国战争电影校花贴身高手电影新出鬼片香港电影新的鬼片中国电影徐克电影大全一个失去记忆的年轻人为了生存加入拾荒者大军,随着不断地探索,记忆也在慢慢恢复。时间流逝,脉络日渐清晰,彼时他才恍然,谁都无法逃脱命运的拨弄……曾经他傻了五年,遭同村人排挤。 一朝清醒,他偶然获得医药传承。 难得一见的千年人参,他随手即可培育,从此开启了妖孽人生…… 医术渡人,丹药惊世! 他玩转都市,最终却选择归隐乡野,成为全网膜拜的隐世药圣!启立三年,天际出现数扇高达百丈的青铜古门,就这样凭空伫立在这东域上空,已逾三类文明的蓝星众联邦高层随之召开了紧急会议,大预言师李落生用其余生120年的寿命堵上生涯的最后一次预言。却之迎来寥寥几笔: 长生众,长生涂,一朝功成万星枯。 启立五年,西域出现不明病毒的爆发。中毒之人皆出现行动僵硬,痛感全无,对一切能动之物开启疯狂地攻击和撕咬,常人之力不可制。 启立八年,各域超凡之人如雨后春笋般冒出,中域镇魔司开始张贴超凡录,记录各方超凡之众,对其展开追踪和调查,期超凡之人为镇魔司所用,以镇五域妖魔鬼怪,魑魅魍魉。 无尽世界有无尽故事,无尽故事,生无量因果。因果纠缠之下,必有逢厄遭难后不能释怀者。 冰消为博一线成人造化,穿梭诸多世界,证神魂唯一。解彼灾厄,全我机缘。剑去池空一水寒,游人来此凭栏干。世间万事消息尽,只有青山好静观。 叶乘风只是想安安稳稳的在穿越后活下去。但命运却不停逼迫着他前进。逼着他成为人们口中的侠【系统+无女主+穿越】(萌新作者,文笔不好勿喷) 刘铭死了,但又没完全死。准确的说,他,跟随潮流一起穿越了。穿到了一个名为哈利波特的魔法世界,而他生前就是一个哈迷。 但这个哈利波特世界跟jk罗琳写的哈利波特有所出入。比如,这个世界并没有黑魔王,詹姆和莉莉也好好的活着,哈利·波特还多了个双胞胎哥哥。 而刘铭穿成了哈利的双胞胎哥哥伊雷·波特,当然作为穿越众中的一人,金手指也是必不可少。所以当他穿越到这个世界一年后。他得到了一个名叫霍格沃茨最强抽卡的系统。 【恭喜抽到传说卡:黑魔法精通】 【恭喜抽到传说卡:我蓝超多】 【恭喜抽到技能点】 【恭喜抽到传说卡:变异蜷翼魔】 …… 伊雷无奈的摊了摊手“没办法,太欧了”这是一个纷乱的年代,朝廷只顾扩张版图,谁不服就把他打服,但残暴的统治只会招来无休止的反抗,在饥饿与贫穷交织,瘟疫与压迫并行之下,也不知有多少支义军揭竿而起,为了民族大义,为了平等和自由,抑或只为一口饱饭而战。就在这个民不聊生的年月,天空一声巨响,张钢铁被一种神秘力量送上了场,来不及和自己的时代说再见,来不及温习历史知识,就这么两手空空而来,那么,手无缚鸡之力、襟怀坦白的张钢铁会有怎样的遭遇?被无情的大时代生吞活剥?被冷血的江湖人随意宰割?还是凭借过人的勇气和胆识杀出一条血路? 欢迎点评前三部《张钢铁相亲记》、《张钢铁哄娃记》、《张钢铁撞鬼记》,均已完结。震惊,穿越异世界之后我和好兄弟竟成了“cp”?携手打怪升级却屡屡遭遇爆笑窘境 ,哥们,这究竟是什么鬼地方啊我想回家!![风语有经年]是集散文、美文、短篇、诗词、短小说等为一体的抒怀作品,值得文学爱好者欣赏。上古世界,神魔共舞,凶兽横行,修士纵横…… 这一切终归跳不出天道法则的支配。 净世法则之下,一切皆归虚无。 毁灭不过一瞬间,重塑辉煌却需无数岁月。 天道崩灭,推倒重塑,谁甘心再入轮回!
苦海无人间 大秦:我靠读书系统成圣闲 我的世界之我不是玩家 异界第一装逼王 诡遇奇闻录 虚实元宇宙 灵异复苏:世界崩坏五十年 神降谕旨 太古第一神王 黑渊术士 无限求生 崩坏世界的刑天铠甲 开局:我用石头换功法 天道圣歌 我在宇宙做仙帝 玄幻:四域神尊 南靖武侠传 末日下的神 天域剑圣 末日道士行 新出的美国战争电影 向华强 70年代电影 悬疑对决电影解析 笑傲江湖任贤齐版电影 兄弟的朋友电影下载 新出鬼片香港电影 悬疑对决电影解析 像明星之恋的外国电影 新出的美国战争电影有哪些 驯龙高手1电影免费粤 幸福 电影 2002印度 幸福 电影 2002印度 新出鬼片中国电影 向华强 70年代电影 新南征北战电影完整版 笑傲江湖任贤齐版电影 熊出没之情况空间电影 新出的美国战争电影 兄弟的朋友电影 新言情时代 电影 向华强 70年代电影 新言情时代 电影 兄弟的朋友电影 邪 电影下载 向华强主演的电影 新出鬼片中国电影韩国 新出的美国战争电影 兄弟的朋友电影 兄弟的朋友电影 新出的美国战争电影有哪些 笑傲江湖任贤齐版电影 邪剧情香港电影 小火车 电视电影 新南征北战电影完整版 新出鬼片中国电影 校花贴身高手电影 小火车 电视电影 悬疑对决电影解析 新出鬼片中国电影 信仰的阴谋电影好看吗 校花贴身高手电影 像明星之恋的外国电影 新的鬼片中国电影 熊出没之情况空间电影 邪电影百度云 邪剧情香港电影 幸福 电影 2002印度 校花贴身高手电影 新出鬼片中国电影韩国 许志安电影 警察 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星官网 医世神婿 武道成源 不谓仙 仙帝的强者儿子 椅阑醉琼枝 葡京官网 快连下载 欧博官网 葡京官网 欧博官网 许志安电影 警察 幸福 电影 2002印度 熊出没之情况空间电影 向华强 70年代电影 新出鬼片中国电影韩国 新言情时代 电影 向华强主演的电影 像明星之恋的外国电影 向华强 70年代电影 新出的美国战争电影 像明星之恋的外国电影 许绍雄最新电影 兄弟的朋友电影 邪 电影下载 校花贴身高手电影 悬疑对决电影解析 新出鬼片香港电影 新的鬼片中国电影 新出鬼片中国电影韩国 凶魅 电影下载 邪剧情香港电影 驯龙高手1电影免费粤 新的鬼片中国电影 兄弟的朋友电影下载 兄弟的女人 电影在线 小火车 电视电影 兄弟的朋友电影 新出的美国战争电影有哪些 信仰的阴谋电影好看吗 新出鬼片香港电影