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
高级职称论文多少字概率方面的论文高中英语有效教学论文服装结构论文工程测量技术论文题目高级职称论文多少字对材料专业的认识论文高中英语有效教学论文迪士尼筹资的博士论文电子商务论文研究意义德育答辩论文手册高级职称论文多少字动物应激医学论文德育答辩论文手册高中英语有效教学论文电子商务论文研究意义对法律权威的思考论文工程监理与造价论文工程监理与造价论文感觉与知觉论文复议记录研究生论文导师指导论文心得体会迪士尼筹资论文翻译目的论的有关论文工程测量技术论文题目概率论应用论文2000字服装结构论文翻译目的论英语论文翻译目的论论文本科动物应激医学论文乱世佳人从亡灵开始逆袭之路。【简介:御兽 +单女主+宠物+搞笑】 源星这个奇妙的世界,充斥着许多既美丽又强大的生物,“月渊兽 幽冥龙 婆罗花……… 人类只要达到16岁就会觉醒属于自己的本命契约兽。 而牧清辰则不一样他一出生就有了自己的本命契约兽……“暗黑金龙王” “龙皇大人你是公的还是母的啊! “龙皇大人为什么我和别人不一样” “龙皇大人你为什么会说话啊!” “闭嘴!” 石灵日久变成一个玉梅树,不断因为各种各样的情况,死亡,穿到另一个新世界。逐渐变强修炼。【老白文+单女主+扮猪吃虎+轻松搞笑】 林一穿越到蓝星一个穷困的大学生身上,为了给家里的父母治病,同时供妹妹上学,原主借了一屁股贷款,同时一天打两份工,最后猝死在工地上。 魂穿此身,林一也被原主各种贷款压得喘不过来,此时此刻,林一游戏系统觉醒,在这个精品游戏匮乏的蓝星,林一先是祭出两款沙盒神作,对蓝星单机市场降维打击,同时又以雷霆速度组建自己的3a游戏项目组,带给蓝星一个又一个的游戏奇迹!江湖是一张密密麻麻的网,上面尽是各式各样的奇人。 痴迷做菜的老厨子,袍下有七把刀,名为北斗七星。 千里寻师的小徒弟,袖里藏着一蓑烟雨。 拎着巨锤的打铁少女,扬言自己挥的是刀法。 满腹牢骚的穷酸书生,天天提笔着墨,练习他那永州八“贱”。 而我们的主角,一个奇经八脉被封的废柴,偏要逆天学武,带着一只腹黑毒舌的狐狸,独自踏上遥远的复仇之路。一人一尺,纵横天下。 横亘八荒,竖劈九州,驰骋六界,傲然封神。月高悬于空,星不见其影。 沉眠的暴君从历史中苏醒,漆黑的双翼划过破晓的黎明;巍峨古堡跨越了尘封的的记忆,矗立在洛尔维亚的群山之巅。 当头戴王冠的公主睁开双眼,从死亡归来的旅人重新握住剑柄—— 国王湖的水面不再平静,却依旧深不见底。“我只是像救活她……”弓背霞明剑照霜,秋风走马出咸阳。胆气豪纵斥八荒,逆旅平明夜流殇。 生命的意义,就是存在,为了存在,有时甚至可以放弃生命。人生可以选择放弃,但绝不能放弃选择,这是每一个生命所应拥有的权利,这,就是天道。二十年前,一场大火,父母双亡,与妹妹分离。 二十年后,接到刺杀任务,在战斗过程中,猜测目标是和自己分开了二十多年的妹妹。 因为这个猜测,导致任务失败,受到组织惩罚,“意外”死亡。 重生后,在成长路上,发现了二十年前的那场大火里,还隐藏着不为人知的秘密……柳叶和,孤儿,独自一人去泰山游玩,一不小心摔落悬崖。醒来发现自己穿越到了天元大陆,成了某个门派的大师兄。当了大师兄就不说了,还多了个小师妹。多了个师妹就不说了,师父却不见了。师父不见了也不说了,关键是整个门派就他们三个人。这下好了,现在只有两个人了。这扯淡的穿越,太雷人了,我想……
青春期之回到学生时代 大司机 为新神的诞生献上荆棘王冠 奇怪侦探所 最强仙帝在都市 全民偷师我创造的功法 屁民传说 龙族噩梦 乡村神医农小乐 盗墓笔录! 我将守护你的未来 这个辅修不寻常 大河文明,起源 与温韬同行 郑熙破面撞物异世人生巅峰 寒门小王爷 KOF97 大蛇篇 我的,灵判大人 网游之屠龙勇士 白日谣 概率论大作业论文 电气职称论文格式模板 对法律权威的思考论文 工程监理与造价论文 概率论大作业论文 翻译目的论 论文 对建筑的思考论文 东野圭吾秘密论文 概率论应用论文2000字 动物应激医学论文 迪士尼筹资论文 迪士尼筹资论文 翻译目的论的有关论文 电子商务论文研究意义 感知觉有关论文3000字 工程测量技术论文题目 对建筑的思考论文 概率论应用论文2000字 复议记录研究生论文 高级职称论文多少字 电气职称论文格式模板 高中英语有效教学论文 概率方面的论文 导师指导论文心得体会 东野圭吾秘密论文 翻译目的论的有关论文 概率论应用论文2000字 概率方面的论文 复议记录研究生论文 概率论应用论文2000字 工程监理与造价论文 电气职称论文格式模板 服装结构论文 高级职称论文多少字 翻译目的论的有关论文 工程测量技术论文题目 服装表演鉴赏论文 对建筑的思考论文 翻译目的论的有关论文 服装表演鉴赏论文 工程测量技术论文题目 电梯维修保养毕业论文 感觉与知觉论文 对建筑发展论文范文 导师指导论文心得体会 电气职称论文格式模板 迪士尼筹资论文 服装结构论文 翻译目的论论文本科 对材料专业的认识论文 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 手能伸进动漫?拿出至尊骨 东京热战纪 一个陌生男孩的来信 来自世界的精神攻击 恒古龙尊 万利官网 欧博官网 皇冠登3出租 万利官网 快连下载 迪士尼筹资论文 对建筑的思考论文 高级职称论文多少字 迪士尼筹资论文 概率方面的论文 感知觉有关论文3000字 概率方面的论文 电梯维修保养毕业论文 翻译目的论 论文 电梯维修保养毕业论文 工程监理与造价论文 动物应激医学论文 翻译目的论的有关论文 对法律权威的思考论文 翻译目的论论文本科 工程监理与造价论文 感知觉有关论文3000字 翻译目的论论文本科 东野圭吾秘密论文 感觉与知觉论文 高中英语有效教学论文 电子商务论文研究意义 服装表演鉴赏论文 概率方面的论文 工程测量技术论文题目 概率方面的论文 对法律权威的思考论文 概率论大作业论文 导师指导论文心得体会 翻译目的论英语论文