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头像头像动漫最热头像小清新长发yy头像大全男生小雷戴眼镜自拍女生头像图片手捧鲜花女孩头像头像小清新长发真人自拍女生头像图片大全图片手捧鲜花女孩头像好看的颜色头像图片女生戴眼镜自拍女生头像图片关于钓鱼的男头像图片可爱呆萌动物头像卡通头像弄成动态旺仔蓝色头像男生头像听耳机头像可爱呆萌动物头像卡通yy头像大全男生小雷猫头像带字头像女生头像一个人的图片带字单纯可爱的女孩 头像女生头像一个人的图片带字三个闺蜜动漫头像猫咪装旺仔蓝色头像男生头像我是一个头像图片现在是2077年,由于地球的能源开始缺少和人口逐渐增加,几年前各个大国开始合作,为了全人类,开始向太空甚至宇宙前进。而我则是我国一名宇航员兼飞船科技工程师,在这个年代我将为了全人类开始我们的宇宙航行之旅!这里没有无尽的斗气,没有瑰丽的魂环,有的只是无尽的诗词和读书人为尊的世界。 浩然正气孕忠魂,文华之气惊诸圣。 拳打诸子百家,脚踏天妖南蛮。 无数读书人长叹,天不生孟飞,儒道万古如长夜!原本吴向东作为医院高新人才引进计划的成员而备受瞩目,却因为一场突如其来的医疗事故坠入深渊,不但被医院打上“推诿病号”的烙印,更是在同窗的推波助澜下被医院发配到乡下干起了赤脚医生,耽误了前程。 虽然多年后他凭借精湛的技术在医疗行业中闯出属于自己的一片天地,却始终因为那件事被人诟病,无法将自己的健康理念推向全国,而后在某次醉酒中他发现自己重新回到1999年的那场医疗事故的当晚。 于是那个男人回来了,他凭借前世经验,在那个单纯以治疗疾病为目标的年代,始终坚持以病人本身为治疗原则,在他的带领下,医疗行业发生翻天覆地的变化,而他和自己的团队也在一次次医疗事件中,逐步登上世界医学的舞台并伫立在世界之巅。“无敌于这世间之四刀之第一招之龙之虚影附身之世界第一刀之神龙刀!”这是一个少年给自己招式起的名字未来,现实世界与虚拟世界交织,脑机接口、意识上传,虚拟触觉技术先后突破,zero公司研发了一款名为《零世界》的元宇宙,来使人类脱离死亡实现意识永生。 然而,在诞生25年后,zero公司一场更大的阴谋酝酿其中…… 重生后的罗飞,带着一群志同道合的伙伴,再一次踏上征程……我捡了个来自三千年前的巫女,但她是诸神选定的祭品。 还好温柔可人的学姐也钟情于我,可她为什么也是魔神复活祭品啊! 所以,为了拯救我的祭品妹子,啊不,为了拯救大劫将至的世界。 我,杜秋羽,一个平平无奇的大学生,站在了一众复苏的上古魔神面前。 “魔神共工,我是你的应劫人!” “黄毛小儿,就凭你?” “吃我一发云爆弹啊!魂淡!” 和谐社会,禁止活祭! 看我科学应劫!恶魔确实存在,就连不同文明的神话传记亦确有其事。 虽然二十一世纪的今天已经没有人相信,但天界与魔界的战争在暗地里已经持续了二千年,每天都发生在你我身边,只不过普通人无法察觉。 教会一直隐瞒恶魔的存在,没想到机缘巧合,却给一位少年遇上了。 血气方刚的少年遇上薄命的梦魔,还有女神适性99%的巫女,谁也没有料到这正是终结天魔战争的契机……死亡之后,异界重生,完成夙愿,成就空古道尊之位,名震诸天。本书一切内容纯属虚构,剧情以小说世界观为准,设定和现实世界有一定差异性。 这是一部战争向的科幻作品,这里描绘了人类的发展历程。 在黑暗的星空之中,在利益与道德之间,人类该作何选择? 面对比自己弱小的原始文明,亦或是强大的奇迹文明。 加入,守护,掠夺,进攻。 联合舰队,启航! 鸽子进化成不那么鸽的鸽子了!尽量一天一更。 本书是原创世界观,世界观很庞大所以需要大量时间来概述。 这本书讲的不是一个人,而是一个世界。人间的无常,俊俏的神灵。 世间律法不及之处,人间黑暗遍布的深渊。 不要唾弃世间的不公,我就是人间最公平的判罚者
创世修心决 天位之龙 四颗丸子的未知世界 弃婿柴小明 真实网游之启源 古神林昊天 只有我能用召唤术 一条舔狗的使命 我!酒剑仙,蜀山签到三百年 山村小仙农 独行山海 逍遥小捕快 星燃X鬼魂袭 耀世陨星 复仇男神 灵气复苏:修真临至 刀剑天武 诸天,从华山开始 九龙圣祖 异瞳者1 很?诺哪猩?头像 邪恶头像动态图片大全 百度 关于钓鱼的男头像图片 头像弄成动态 最帅qq二次元头像 三个闺蜜动漫头像猫咪装 关于钓鱼的男头像图片 男头像不要非主流 单纯可爱的女孩 头像 真人自拍女生头像图片大全图片 一对对情侣头像 一对对情侣头像 qq头像长乱发秃废 邪恶头像动态图片大全 百度 彩字秀制作qq头像 头像弄成动态 非主流不带字男头像图片 很?诺哪猩?头像 有关冬天的网名女生头像 头像小清新长发 邪恶头像动态图片大全 百度 头像小清新长发 有关冬天的网名女生头像 可爱呆萌动物头像卡通 戴眼镜自拍女生头像图片 qq头像长乱发秃废 很?诺哪猩?头像 有关冬天的网名女生头像 有关冬天的网名女生头像 单纯可爱的女孩 头像 头像弄成动态 黑暗欧美正太头像 动物温暖头像 彩字秀制作qq头像 猫头像带字头像 女生头像一个人的图片带字 动物温暖头像 关于钓鱼的男头像图片 猫头像带字头像 好看的颜色头像图片女生 女生头像一个人的图片带字 男头像不要非主流 旺仔蓝色头像男生头像 非主流不带字男头像图片 手捧鲜花女孩头像 黑暗欧美正太头像 一对对情侣头像 女生头像一个人的图片带字 qq头像长乱发秃废 女的在水里的头像 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 人在娘胎:隔壁女帝想踹我出去 神武1 飞鱼特工队之烈火雄心 求戟 在异世界闹革命 快连下载 亚星管理平台 亚星官网 快连下载 亚星管理平台 女生头像一个人的图片带字 三个闺蜜动漫头像猫咪装 男头像不要非主流 男头像不要非主流 旺仔蓝色头像男生头像 旺仔图片头像蓝色 单纯可爱的女孩 头像 女生头像一个人的图片带字 彩字秀制作qq头像 戴眼镜自拍女生头像图片 女的在水里的头像 猫头像带字头像 好看的颜色头像图片女生 我是一个头像图片 旺仔蓝色头像男生头像 一对对情侣头像 三个闺蜜动漫头像猫咪装 三个闺蜜动漫头像猫咪装 男头像不要非主流 戴眼镜自拍女生头像图片 qq头像长乱发秃废 旺仔蓝色头像男生头像 很?诺哪猩?头像 三个闺蜜动漫头像猫咪装 旺仔图片头像蓝色 头像小清新长发 可爱呆萌动物头像卡通 非主流不带字男头像图片 很?诺哪猩?头像 我是一个头像图片