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
专业的宝宝起名软件去除打码工具软件万能图片像素大小调整软件美容业软件win10优化系统什么软件好专业的宝宝起名软件下载ps3d软件万能图片像素大小调整软件把字拼图形的软件下载电影的片头片尾制作软件广西恒智天成软件下载专业的宝宝起名软件通用会员散客管理软件广西恒智天成软件下载万能图片像素大小调整软件电影的片头片尾制作软件dism++软件的pewin10优化系统什么软件好win10优化系统什么软件好天津百旺金赋软件下载读屏软件开发指南stc isp 含软件把字拼图形的软件下载电脑玩cf必备哪些软件下载适合小学的一些教学软件带虚拟光驱的解压软件美容业软件什么软件能预览ai文件天津百旺金赋软件下载手机dwg看图纸软件怎么用男护士转生异世界,竟然被职业评定选择成了最稀有职业-男性圣职者?本来以为可以在异界享受人生,迎娶公主,走上巅峰,没想到卷王居然就在我身边?内卷什么的之前已经受够了!为了对抗内卷,全都点了治愈,男圣职者平凡而又非凡的异世界生活,从现在开始!不要在黑夜里高歌,怕惊醒那些沉睡在暗处的猛兽。 无穷浩瀚的宇宙,魔法,修真和科技并存。 这是一个探索未知的传奇,也是一首歌颂平凡的小曲。图书管理员穿越成废帝刘辩,没地盘没资源没人才,那又怎么样。手握超级召唤系统,文臣猛将会聚一堂,青梅煮酒论英雄。离家出个走,居然遇到了一名博士。 他们之间的缘分远不止一面之缘,一些奇奇怪怪的东西随着两人的接触,渐渐跑进了他的生活。 古怪离奇的东西变成了自己的日常。 世界的本来面目被一点点揭开,能窥觑到的每一个部分都让人惊异万分且难以承受! 而这些仅仅是大千世界的九牛一毛而已! 就算知道了太多太多,需要很长时间去消化。 那这,是否又真的是世界最真实的那一面呢? 这博士,究竟又是怎样的…人呢? 他又小心翼翼的维护着怎样的秘密…? 【对世界的新认知!】 【对科技的惊发现!】 【对未来的再思考!】 【认知崩塌重新排序的宇宙狂想曲!】别人穿越都是封侯拜相,为啥我穿越过来就只有半个小时的命? 还好有系统送了100亿两黄金! 花1两黄金就得1分钟寿命?这买卖划得来啊! 有什么事情,是用金元宝解决不了的? 1个金元宝解决不了,那就用100个、1000个! 一个落魄书生,靠着黄金开道,称霸天下的故事!2022.6.29的一天一个传奇老玩家正在攻杀突然电脑屏幕爆炸我就莫名奇妙的来到玛法大陆开启了我的传奇人生异界之中,宗门无数,强者林立,却受天道制裁,在天之下却无发比拟天道,在天道之下,我陈逸却要这逆天而行。 这是一个源灵的世界,也是人族凋零的世界,万族镇压,人族前路何在? 王战穿越源灵大陆,成为王家老祖,觉醒源灵召唤系统,老骥伏枥,志在千里,以暮年之身,再为人族血战八方! 万族天骄欺压,人族天骄嬴政、刘彻、李世民等艰难前行,只为护人族百世不衰! 那一日,满头华发的王战自大后方而出,向万族宣告:吾乃人族天骄护道者,谁敢欺我人族天骄?欺我人族? ………… 大儿子王腾:“我人族出了护道者叫王战?跟咱爹同名啊!” 孙子王浩:“爸,不用怀疑,那就是爷爷!我跟他老熟了!” 孙女王若书:“我爷爷超无敌!” 你说过你会回来,所以我一直在等,兜兜转转,恍惚间前年时光已逝,我跨过万水千山,只为找到今世的你,可你却一次次的把我忘记,我不怪你,因为我知道,你会想起所有所有,为了帮助你忆起以前的事情,我写下了这些文字。流水线工人意外穿越至异界,开启了他的一段传奇人生。
命之途 王者之巅之巅峰之战 万神帝尊 我的徒弟都是宗师级 被迫成为副本boss 司法仙官 灵气复苏:我有个坑爹系统 白骨巡天记 活着成魔 九曜雷仙 没灵脉,那就成为卷轴师! 妖鬼退散:我来自英灵殿 帝国路 原来我真是世外高人 六趣界 热血警察 突破云霄 我真的只想躺平 我会踮起脚尖 第四火种 去除打码工具软件 电影的片头片尾制作软件 dism++软件的pe win10优化系统什么软件好 去除打码工具软件 逗拍同功能软件 tekla软件是什么软件下载 暴风格式转换软件 逗拍同功能软件 通用会员散客管理软件 数据博士软件怎么样 数据博士软件怎么样 电脑玩cf必备哪些软件下载 电影的片头片尾制作软件 专业的宝宝起名软件 适合小学的一些教学软件 能框框的软件 带虚拟光驱的解压软件 强力图片压缩软件 万能图片像素大小调整软件 哪个软件约炮舒服 万能图片像素大小调整软件 强力图片压缩软件 stc isp 含软件 寻人启事图片制作软件 手机截图备注软件 带虚拟光驱的解压软件 强力图片压缩软件 读屏软件开发指南 带虚拟光驱的解压软件 win10优化系统什么软件好 哪个软件约炮舒服 美容业软件 专业的宝宝起名软件 电脑玩cf必备哪些软件下载 适合小学的一些教学软件 美容业软件 tekla软件是什么软件下载 电脑玩cf必备哪些软件下载 能朗读课文的是什么软件 适合小学的一些教学软件 暴风格式转换软件 天津百旺金赋软件下载 能框框的软件 广西恒智天成软件下载 哪个软件约炮舒服 数据博士软件怎么样 适合小学的一些教学软件 手机截图备注软件 下载ps3d软件 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 从蛇开始的进化 万域剑帝 三国昭昊传 百劫历 莫斯肯漩涡 澳门葡京官网 AG真人 欧博官网 澳门葡京官网 欧博官网 通用会员散客管理软件 逗拍同功能软件 美容业软件 stc isp 含软件 win10优化系统什么软件好 手机截图备注软件 dism++软件的pe 把字拼图形的软件下载 天津百旺金赋软件下载 游戏验证码自动输入软件下载 手机截图备注软件 暴风格式转换软件 游戏验证码自动输入软件下载 能朗读课文的是什么软件 寻人启事图片制作软件 什么软件能预览ai文件 去除打码工具软件 数据博士软件怎么样 手机截图备注软件 专业的宝宝起名软件 天津百旺金赋软件下载 强力图片压缩软件 电影的片头片尾制作软件 手机dwg看图纸软件怎么用 专业的宝宝起名软件 带虚拟光驱的解压软件 强力图片压缩软件 win10优化系统什么软件好 带虚拟光驱的解压软件 电脑玩cf必备哪些软件下载