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
qq头像女社会霸气头像霸气霸气头像动漫头像带字酒头像图片女头像写意赵云萌头像qq头像女社会霸气头像头像恐怖男酒头像图片爱女人头像qq头像双影女生韩版qq头像女生绿色森系酒头像图片qq圆形的头像大全图片qq头像女生黑衣服帅气3点赞头像qq头像双影女生韩版狂三大头像爱国头像男爱国头像男宝宝动态搞笑头像安静的卡通女生头像女生头像女生头像女生爱国头像男爱女人头像霸气优雅的美女头像图片赵云萌头像霸气可爱qq头像带字头像女生女头像霸气优雅的美女头像图片宝宝动态搞笑头像qq圆形的头像大全图片穿越洪武年间,身为凤阳县令的岳麟,竟被权相胡惟庸弹劾贪污! 皇帝大怒,微服私访,被当做“暴发户”的老朱,自然得到了岳麟的亲切接待。 “这是后膛枪,买了它,北元鞑虏灰飞烟灭,任谁都要给你几分薄面!” “这是工艺坊,十岁小孩弹溜溜,百岁老人盘核桃,出口一本万利!” “这是福利院,老有所依,幼有所养,以后儿孙不孝,免费入住!” 岳麟只觉得,暴发户老朱身后的几个青年,看他的眼神之中充满杀气。 “奉天承运,皇帝诏,曰:岳麟奉旨贪污,为我大明富国强兵!” 沈清风本是秦皇之子,原以为能够荣华富贵一生,可还没来得及享受,就被自己的青梅竹马杀害,就此陨落。 千年之后,他意外重生,而自己的青梅竹马已经成为了蓬莱界唯一的皇,这一世,他能否报仇,成为那凌驾众生之上的神。五年前,他是第一玄门天骄,因遭至爱背叛,身死 道消。 一朝重生,他是苏家弃婿,偶得无上医经和传奇宝 鼎,从此废物接盘侠成最强奶爸。 无数年前,三界强者们为阻止域外来敌,纷纷踏上神魔轮回路,却遭人算计,主角在最后时刻施展神魔转体大法以天地真灵之躯转世重修。回归后却发现和他一起踏上神魔轮回路的强者们的家族和宗门皆已没落,主角无奈道,罢了,曾经的辉煌本座带你们重走一遍。这一世主角不在仁慈,战天庭,踏佛国,闯九幽。既然不去守护三界,那你们就别占着这三界的气运了。“哥哥你说他们为什么这么讨厌我们呢” “鸣人,这件事情等过几年我在告诉你” “可是我现在就想知道” “乖”世人虽渺小,可是每个人都想挣脱束缚。 诸神虽伟大,可是神也总有陨落的一天。 仙侠恩怨,王朝争霸,爱恨情仇。 且看他们演绎一场不朽传奇。 最新新闻:一位普通父亲的坚持,竟攻克了医学界百年难题。 ...... 上一世,女儿小彤身患溶血性尿毒症晚期,无药可治。江辰为女儿换肾,却并未挽回女儿的生命。 重活一世,江辰获得医学推演系统。 这一次,他无论如何也不会重蹈覆辙。 他拒绝了妻子离婚前的换肾提议,决定以自己的方式挽救女儿的生命。 所有人都在骂他自私,怕死,连女儿都不救,不配当父亲。 可江辰却用实际行动打了他们的脸。 他苦心钻研医学知识,认真推演各种救治方法。 一年后,女儿康复。 事情曝光,夏国医学界震动。 数年后。 一道道医学难题在江辰手中攻克,世界轰动!一个传奇网游,一把剑,看一个游戏天才如何问鼎武道顶峰,成就一代枭雄,而命运之神又会如何安排呢?是懦弱还是其他?是废材蠢才还是其他?梦里明六道,觉后了大千。 她穿越万载而来,只为改变他的命运,这或许只是他的一个梦,但却是她的所有。 本书写的是帝国权谋,看的是儿女情长、兄弟情义。 穿越到文娱行业刚刚起步的平行世界,方淮南激活了影帝系统,可以获得前世任意一位影帝级人物的表演经验! 他一个人就开创了华娱影坛十年的辉煌时刻! 他是《无间风云》里城府深沉的黑帮老大琛哥; 也是《枪燃》里忠义痞气交织的打手阿来; …… 正当所有人都以为方淮南只会演反派角色的时候, 他跑到横店去出演了《猫妖传》里五分钟的配角, 将盛唐气势下,那位如醉似癫的李白演出了神韵! 这时,所有人才知道方淮南的戏路宽阔到何等地步! …… 面对采访,融合了上百位影帝经验的方淮南很谦虚的表示: “我,不过是站在了巨人的肩膀上罢了。”
又见海棠镇 带着系统穿越电影世界 永神纪元 羽毛球无敌的我只能穿越了 末武劫 幻梦长生 人生陆漫漫,乔木不可栖 余烬:文明崛起 虚界神主 坑爹:我坑到修仙界 重生!我还是六界最强法师 老婆重生后,我成了世界首富 天璇武极 当异世界降临 清风拂海 开局,我以登临巅峰 我是up主 千载之旅 开局遭遇空难 自然神灵录 霸气黑界头像 qq头像排行榜兄弟 狂三大头像 赵云萌头像 霸气黑界头像 霸气女生动漫呆萌头像带字头像女生头像女生头像 狂三大头像 qq头像太阳情侣头像 霸气可爱qq头像带字头像 qq头像小孩儿搞笑图片 爱女人头像 卡通肉头像 白色简约男生卡通头像图片唯美壁纸 qq头像排行榜兄弟 qq头像女社会霸气头像 赵云萌头像 演绎头像 霸气可爱qq头像带字头像 数字一头像 酒头像图片 qq头像排行榜兄弟 3点赞头像 霸气霸气头像动漫头像带字 qq头像女生黑衣服帅气 qq头像双影女生韩版 白色简约男生卡通头像图片唯美壁纸 霸气可爱qq头像带字头像 霸气霸气头像动漫头像带字 数字一头像 霸气可爱qq头像带字头像 赵云萌头像 qq头像女生绿色森系 女头像写意 qq头像女社会霸气头像 霸气优雅的美女头像图片 赵云萌头像 女头像写意 狂三大头像 白色简约男生卡通头像图片唯美壁纸 3点赞头像 女生女头像 qq头像小孩儿搞笑图片 备胎的头像绿色 演绎头像 qq头像女生黑衣服帅气 qq头像排行榜兄弟 卡通肉头像 女生女头像 白色简约男生卡通头像图片唯美壁纸 头像恐怖男 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 风楴夜 全民震惊,你管这叫贫困户? 末日降临:我带着全村搞基建 我六耳从洪荒开始布局西游 炎帝! 百度 百度 百度 百度 百度 霸气霸气头像动漫头像带字 qq头像双影女生韩版 qq圆形的头像大全图片 备胎的头像绿色 霸气霸气头像动漫头像带字 爱女人头像 霸气可爱qq头像带字头像 qq头像太阳情侣头像 爱国头像男 qq头像小孩儿搞笑图片 白色简约男生卡通头像图片唯美壁纸 霸气黑界头像 白色简约男生卡通头像图片唯美壁纸 赵云萌头像 备胎的头像绿色 白色简约男生卡通头像图片唯美壁纸 爱女人头像 备胎的头像绿色 3点赞头像 qq头像排行榜兄弟 3点赞头像 qq头像女社会霸气头像 女生女头像 数字一头像 霸气可爱qq头像带字头像 霸气黑界头像 qq头像女生黑衣服帅气 女头像写意 qq头像女生黑衣服帅气 狂三大头像 亚星官网 亚星官网 万利官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 欧博官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网