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
信息安全人才需求图信息安全审计 公司网络安全保险是什么意思网络安全内容大全计算机网络安全等级?信息安全目的,-1耒阳做网站网络安全合规办公室网络安全风险青岛网站建设‘’中国网络及信息安全法整合营销推广信息安全技术 数据库管理网络安全年网络安全意见建议江苏网站建设效果滨江网络安全公司银行信息安全等级保护,-1企业营销网2014网络安全报告信息安全风险评估作用网络信息安全实训总结交友网站建设公司网站管理中心可以修改内容上传图片不能修改主页画面网站建设目标建立网站备案需要什么资料如皋网站制作2016 网络安全竞赛 工信部常用微信营销方式信息安全监管网络营销推广前景王晓与王明意外下触发了传承血脉洗淬一瞬突破,又在种种机缘之下得到了父母的信息,踏上仙踏,为亲人报仇。简介:(无敌+签到+仙魔一体) 辰君宇穿越到一方玄幻世界,因为前身不知如何成了废体,但万幸获得了签到系统,开局在仙魔战场获得《仙魔录》与仙魔道体 天骄榜前签到,获得万年道心 镇妖塔前签到,获得《玄黄轮回剑典》 不知名山峰签到,太古圣地一座...... 不知过了多久有一座圣地成了这万界的第一势力 回首望着诸天万界之中,都流着在这世上有位无敌的剑客,没人能接的下他三剑。也流传着恶人榜上的第一恶人无恶不作,实力至上........暗恋多年的感情始终无果,挡在我面前的是生活和现实。 现实和生活是沉重的枷锁,牢牢困住我的心中的理想。 纵使我奋不顾身,也只能头破血流。 古怪女孩出现在我的生活中,为我平淡而又灰暗的生活增添了一抹光彩,从此她成为了我生命的光。 掩藏在表面之下的,是人性中的恶。本人是新人作者,有什么写的不对的地方望各位读者多多包涵一代仙尊陈子时重生到二十二岁。 上一世,陈子时站在宇宙之巅,却无人相伴。 这一世,重新来过,好好体会这凡尘烟火。 手持一把杀猪刀,斩尽天下不平之事。拥有【满级肉身】的苏叶,穿越异界,成为显魔宗疯魔院的杂役弟子! 被女魔头吊着打,获得天魔神掌。 被老魔头拿头撞,获得种魔大法。 被小魔头当沙包,获得霸王神斩。 …… 在疯魔院当杂役这些年。 有郁郁寡欢的师妹,来疯魔院供奉魔头,经苏叶指点,修成九世女帝! 有身世卑微的凡人,来疯魔院供奉魔头,经苏叶调教,成为天下共尊的魔皇! 有朝廷弃徒的皇子,来疯魔院供奉魔头,经苏叶点拨,成为横扫大陆的一代帝王! * 六十年后,魔道天榜揭示,排序魔道强者,苏叶独占鳌头! 榜单备注——神魔共主! …… 在部落与外来势力集团利益冲突中, 解决问题的最有效手段就是, 挥舞手中的上帝之鞭,那是最通行的语言。 请跟随狙击战神, 进入神秘非洲,统领部落,反抗霸权,重树正义, 铸就封神的传说! 去体验热血澎湃,野性喷张的另一种生命状态。 一代杀神叶君邪,被人称为邪王,一生接暗杀任务数百起,从未失手。如今他已40岁,准备退休,但是组织有规定,退休时必须完成一个组织交代的特殊任务,让他没有想到的是,他的最后一个任务居然是杀掉自己的妻子,最终他还是没能完成任务,遭到了组织的追杀,最后还是没能逃过,不过,在他死后的一瞬间,一片神秘大陆的一个孩子,睁开了一双充满杀气的眼,这个孩子又将在这片大路上搅动什么风云。出来旅游的刘锋,接到了一个跑龙套的机会。 意外触发了神级扮演系统。 在剧组扮演某个角色,根据相似程度,便能获得角色相应能力。 【叮!本次角色‘特种兵’的契合度为30%,您获得特种兵30%的综合能力!】 【叮!本次角色‘学霸’的契合度为50%,您获得学霸50%的学习能力!】 【叮!本次角色‘王羲之’的契合度为73%,您获得王羲之73%的书法能力!】一直想说一个没有任何技能的普通人怎么在一个动荡的年代生活,没有金手指,没有逆天的系统,没有丰富的历史知识,更没有化工知识,对军事更是一个白痴,甚至对古诗词也之记得几首的一个真正普通人,他能否在那个年代生存下来?
网络安全厂商 密码技术是网络安全 注册信息安全专业人员证书 网站jianshe 网站改版升级总结 个人网络安全 个人手机版网站建设 大数据信息安全分析师 学校网站设计 网络营销思路 网络安全英文文献 太原推广型网站制作 校园网站设计 网络营销课的心得体会 免费网站制作新闻 信息与网络安全协会 支付宝的网络营销为例 网站建设的方式 互联网营销前景 2017年网络安全会议 网站后台编辑器 两会提案 网络安全 网络信息安全防护措施 做网站创意 个人信息安全评估办法 个人手机版网站建设 网络安全现状 2017 滨江网络安全公司 国家级网络安全事件 成都公司建网站 信息安全审计 公司 关于信息安全的图片 银行信息安全等级保护,-1 思而忧网站 中国信息安全网作业,-1 龙岗网站设计效果 2016 网络安全竞赛 工信部 南京网络安全类公司排名 密码技术是网络安全 深圳网站维护公司