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
学术论文的科学性创新性学术性规范性和可读 ?党的群众路线教育实践活动论文精选国外物理论文网站农业机械学报的论文学术性怎么写考古研究论文学术论文的科学性创新性学术性规范性和可读 ?系统性红斑狼疮护理论文国外物理论文网站浅谈小学主任德育工作论文常微分方程模型论文机械学术论文发表网站国外物理论文网站初中英语作文论文机械学术论文发表网站论文 数据分析常微分方程模型论文假如我是老板论文什么是技术性论文什么是技术性论文灭菌柜验证 学士论文农村初中班主任工作论文什么是技术性论文浅谈小学主任德育工作论文土地登记制度论文戊戌变法小论文电气设备论文戊戌变法小论文土地登记制度论文灭菌柜验证 学士论文初中英语作文论文我叫吕中天,是刑侦支队的队长 一次在追捕杀人犯的时候开枪失手杀了犯人的妻子 同时我也被撤了职位变成了一个普通人 在那以后我陷入了无尽的噩梦之中 我原本以后我会平平凡凡地度过这一生 可是没想到这一天的出现在一次改变了我的人生。欢迎大家走进C世界,里边有不一样的妖,不一样的王。刘林杰原本是异世开放世界VR元宇宙大游戏《梦拉幻大陆》的一名程序员,可在一次玩家测试中被告知游戏被黑客侵入并制造出了大病毒影响游戏世界平衡,而此游戏开发巨大可让玩家在游戏里身临其境,如同在另一个世界生活;而刘杰空将以玩家身份装备程序公具,进入这个世界与黑客的病毒展开对决以至消灭!并同时拯救修理被破坏的游戏世界!同时还结交了游戏中的人物伙伴一起冒险………………熵定218年,世间流传,史前大陆第一高手第五北靖的灵元现世。 当年带走第五皇灵元的阿僧祇,在他大限将至前,将第五皇灵元元印(将精神力附着在物件上的一种手段。以特殊方式可获取该物件附着的信息)在他的骨质面具上。 世上传言,得面具者,得人皇传承,则得天下。 从此,世间掀起一股寻找面具碎片的浪潮。 第五后裔王小二出生猎户,意外踏入修炼之路。。。。。。一次意外,带来的改变人生轨迹,从此开始了,不一样的人如果只有这样,那我绝不独活穿越异界三年的林锋,成为了神剑宗宗主!   “叮!看到宿主作为一个堂堂炎黄子孙,穿越后一事无成,垃圾到没谱!” 系统愤怒了!    “叮!资源填补升级开始……”    “叮!宿主的宗门获得主峰逆天峰,一百零八侧峰!”    “叮!宿主的宗门获得气运金龙一条!获得神级功法!”    不知不觉中,神剑宗俨然已名动天下,登临巅峰。    林锋:唉,我真没努力啊,奈何系统太给力了…… 由华夏国科技小组首次研发的虚拟真人游戏《神域彼岸》一度火上国际,无数玩家纷纷开启异世界冒险,这款游戏展现的是真人第一视角,将自己的大脑意识传输到虚拟的空间中,来到异界开启战争、打怪、生存,争斗等各种玩法,一度登上国际热搜。 而男主高中生刚刚毕业,在接触到这款游戏时,从刚开始的成长到遇见领路人,在到带领省级争夺域主,之后,更是由于之前丰富的战斗经验,竟然成为了国际参赛员,将代表华夏国与其他国家开启一场虚拟竞技,带领着自己的队伍开启一场成王败寇的道路。 这也是一个唯美的爱情故事,女主双腿残疾本来是永远不会站起来的,但是在游戏里遇到了男主,二人通过一系列冒险和参加比赛,给了她信心,让她有了面对的勇气,到了最后完成了奔赴。她是尊敬的将军官邸的第五位年轻小姐,但被视为无用的废物。由于风流和调情,她最终被她追逐的那个男人的侍从误杀;她是上天喜爱的天才,但最终被一个阴险的阴谋谋杀,所有与她有血缘关系的人都追杀并灭绝了她,导致她。。。真人真事改编古代奇幻小说。故事发生在公元215年三国时期,刘备曹操孙权激斗之时,原二品官员司韦与夫人李冬英一起建立新势力骓驲城。司韦意在一统天下,但在骓驲城内,斗争四起、人心险恶,一场新势力下的宫廷斗剧即将展开...
少年风云志 仗剑啸苍穹 大秦:开局十万大雪龙骑 永恒沉寂的世界 烟雨大唐 横推玄幻:我靠模拟无限升级 天命葬师 万灵之眼 黑白魔都 遇鬼的那些年 神算异世 操刀者 我一生中佼人 鬼仙?我才是好吧! 秦始皇的新生 阴阳,五行诀 初级博弈2:生命永存 血战匈奴 一本医书闯天下 初浮记 机器人焊接论文 论文指导工作计划 假如我是老板论文 考古研究论文 机器人焊接论文 灭菌法论文的结论 假如我是老板论文 有关初四论文 电气设备论文 初中英语新课改教学论文 电影名的翻译论文 电影名的翻译论文 土地登记 论文 论文指导工作计划 学术论文的科学性创新性学术性规范性和可读 ? 考古研究论文 翻译毕业论文选题 电气设备论文 毕业论文知网检测 国外物理论文网站 论文指导工作计划 论文 数据分析 毕业论文知网检测 机械学术论文发表网站 常微分方程模型论文 土地登记 论文 电气设备论文 党的群众路线教育实践活动论文精选 毕业论文知网检测 电气设备论文 考古研究论文 类风湿关节炎论文 农业机械学报的论文学术性怎么写 学术论文的科学性创新性学术性规范性和可读 ? 土地登记制度论文 戊戌变法小论文 农业机械学报的论文学术性怎么写 假如我是老板论文 土地登记 论文 论文 数据分析 戊戌变法小论文 初中英语新课改教学论文 食用菌相关论文 翻译毕业论文选题 机械学术论文发表网站 类风湿关节炎论文 电影名的翻译论文 戊戌变法小论文 土地登记 论文 系统性红斑狼疮护理论文 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星游戏官网 我的宗门有本山海经 长临渊 遮天神帝 从特种兵开始融合万物 重生之回到少年时 快连下载 亚星游戏官网 亚星官网 快连下载 亚星管理平台 电影名的翻译论文 国外物理论文网站 常微分方程模型论文 初中英语作文论文 初中英语新课改教学论文 戊戌变法小论文 党的群众路线教育实践活动论文精选 土地登记制度论文 考古研究论文 什么是技术性论文 戊戌变法小论文 电影名的翻译论文 什么是技术性论文 论文指导工作计划 类风湿关节炎论文 国外物理论文网站 食用菌相关论文 有关初四论文 农村初中班主任工作论文 机器人焊接论文 党的群众路线教育实践活动论文精选 俄语是什么论文 农业机械学报的论文学术性怎么写 机械学术论文发表网站 系统性红斑狼疮护理论文 翻译毕业论文选题 系统性红斑狼疮护理论文 灭菌柜验证 学士论文 假如我是老板论文 浅谈小学主任德育工作论文