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
个人网络安全外贸企业网站网络营销实战系统网络安全意见建议网站建设步骤侧导航网站深圳网络安全快速考证南昌网站建设公司资讯建公司网站南通哪里有做网站的捣蛋捣蛋,鸡蛋不烂,不算好汉。 捣蛋带着满怀的激情,闯荡在这繁花的社会中我爱写神魔小说。异世大陆,强者为尊。 少年陆泽惨遭背叛,却意外获得无上神功,从此龙游苍穹,鹰翱九霄。 杀圣子,灭天骄,夺造化,逆天改命,强势崛起! 一步一登天! 一路披荆斩棘,一剑破万法! 高歌猛进,无所不克,一直走到巅峰。公元2035年,全球爆发生化危机!人类在退无可退之下动用了原子武器,然而丧尸并没有被大量消灭,反观人类自身不断的收到辐射而变异!人类为了自救,集中最顶尖的生物专家研究改善基因的药剂,但与此同时,另类科研人员也终于攻克人类基因壁垒,人与动物结合成为现实!非人,非神,非魔,非畜,非羽,非鳞! 主角李伤,一苦逼创业青年,走尸山,淌血海,闯地狱,戏红尘!一步一个脚印的艰难挣扎在末世,能走出一个什么样的道路,闯出一个什么样的名堂,拭目以待!作为主角“昆仑”因为吃泡面噎死穿越之后,怎么可能没有金手指呢!“恐惧系统”这不就来了嘛!   有没有见讲鬼故事修仙的,我昆仑就是。嘿嘿嘿~   地府消失...   神明消失...   包括过鬼故事也消失...新历0001年,神明降临,入侵地球。 经过15年的艰难抗争,人类文明最终走向灭亡! 大夏守护神林凡重回神明降临三月前,这一世,他要带领大夏,以举国之力迎战神明! 海洋之神,大夏以钢铁长城应对! 天空之神,我大夏巨炮怒指苍天! 凛冬之神,我大夏修建地下熔炉! 这一世,凡人屠神! 国门所在,林凡面对那高高在上的神明,持修罗刀怒目而立。 身后,巨炮林立,钢铁长城,巍峨大夏! “所谓神明,可敢与我一战,可敢与我人族一战。” “可敢入我大夏半步!” 这一刻,人间大夏,神明禁区! 我以修罗,斩神明!这是互联网金融行业的老司机重生后,由一名菜鸟新人,在职场披荆斩棘,一路高升,成长为行业一方大佬的故事; 你可以把小说当做22年爽版职场剧《未生》。面对冷酷的职场现实,用行业新人的眼光来展现互联网金融行业的人生百态...... 22周岁的周致远,具备重生信息优势的他,更像加强版的张克莱; 他扫除金融毒瘤,重新制定行业准则; 他抓住机遇,攥取巨额财富,不忘回馈社会; 他年少多金,心怀理想,收获御姐们的青睐; 他步步为营,改变命运,填补人生遗憾......18年独自生活,无依无靠的乞儿刘田,在人世遭受苦难将死之际,忽遇神秘中年人从天而降,挥手间让其重获新生,并将掌管世间隐秘的天道馆控制核心《天道馆章》交给了他,而后又匆忙离去,此人是谁,又有何目的,刘田这小人物是否能够逆天改命从此走向人生巅峰,就让我们在往后的日子里一同探索,共同见证吧!命运多舛的少年,不谙世事的灵智,两者的结合在九州大陆掀起了阵阵腥风血雨。 在这里也许会看到华夏神话的延续,也许会看到超强的灵宝,也许会看到上古遗迹,也许会看到各种稀奇古怪的异兽,也许会看到魔之本相……“陛下不好了!下凡捉妖的天兵天将全被打趴了!” “陛下大喜事!狱神出手了,妖怪都被打趴了!” “陛下不好了!狱神突然收手……他跑路了!” “酉时了,他…下班了!” 玉帝气得拍了拍龙辇,并且在极度愤怒的情况下愤怒了三天三夜… 三界出了个朝九晚五的楚大佬,从此画风变了。 刚破封的罗睺:三界什么时候出了这么一个猛人?我差点被锤爆! 西方教大佬:+1,现在只敢星期六日出来溜达,因为那俩天,楚大佬不上班 玉皇大帝:楚大佬求求你加个班,当个人吧!
网站改版收费 网络安全相关网站 提供网站建设的公司 南山的网站建设公司 湖南网站制作 网站推广费用 泰安网站设计 公司网站管理中心可以修改内容上传图片不能修改主页画面 常用网络营销推广渠道 ui的含义网站建设 网站方案书 销售营销区别是什么意思 信息安全人才需求图 北京网络安全公司 湖北网络营销方案哪家专业 网络安全与信息化领导 香奈儿网络营销策划书 成都企业网站建设 信息安全都有哪些方向网络营销小案例分析 惠州网站制作 厦门网络推广建网站 珠海网站设计哪家好 国家网络安全支撑单位 香奈儿网络营销策划书 ecshop网站里面有伪静态页面还有部分动态页面不是作弊吧 国家网络与信息安全协调小组 重庆企业口碑营销微信邮件营销 深圳做网站的公司 计算机网络安全课程设计报告 福州建网站 维护网络安全我会做到 关于信息安全的图片 网络安全 证书 营销培训基地 提供网站建设的公司 开展经常性的网络安全 网络安全初学者学什么 常用网络营销推广渠道 网络安全的图片有哪些 中国佛山营销网站建设 江西南昌网站定制 网站制作公司合肥 营销反馈 武汉网站建设公司 简述网络安全的管理策略 办公室网络安全风险 中国网络安全监管 途牛网的营销模式 哈尔滨政务性网站制作公司 网络安全法与网信工作 国家网络与信息安全协调小组 网络安全的图片有哪些 常用网络营销推广渠道 网站到期诈骗 手机企业网站设计 免费企业营销网站制作 北京网络安全公司 网站速度 网络安全活动报道 营销型网站建设制作 高端网站案例 网络信息安全防护措施 网络 信息安全 协会 网站建设推广 搜索引擎 营销 网络安全等级保护2.0 信息安全等级保护申请 个人网络安全 销售营销区别是什么意思 太原市网站制作公司 租车网站建设 电子商务型网站 ui的含义网站建设 网站推广费用 山西信息化和信息安全 国企网站建设 江西南昌网站定制 租车网站建设 惠州网站制作 网络安全等级保护2.0 国家网络与信息安全协调小组 ui的含义网站建设 个人网络安全 为什么我的网站刚续费还是显示域名过期别人能打开我却打不开 如何优化网站 定西网站建设 香奈儿网络营销策划书 银行信息安全等级保护,-1 工业控制网络安全态势 网络安全 打击 为什么我的网站刚续费还是显示域名过期别人能打开我却打不开 网站轮换图 深圳做网站的公司 厦门网络推广建网站 网络安全靶机 信用信息系统安全保护级别 测评资质 公安部信息安全等级保护评估中心 线框图网站 小米网络营销环境分析 武汉网站建设公司 网络安全专家认证 电影网络营销推广 互联网推广营销学院 国家网络安全支撑单位 网络安全初学者学什么 湖北网络营销方案哪家专业 网站建设推广 网络安全.ssl信息过滤ddos 6p营销要素 国家网络与信息安全协调小组 泰安网站设计 方维制网站 浙江网络安全周 深圳专业网站制作多少钱 深圳外贸响应式网站建设 南通哪里有做网站的 qq网络营销策划 北京专业网站建设 没有任何漏洞:信息安全实施指南 2016网络安全雅虎 网络安全靶机 客户型网站 北京网络安全公司 网络安全十三五规划 网络安全与信息化领导 网络安全活动报道 2016网络安全雅虎 网络安全 漏洞 深圳外贸响应式网站建设 网站的颜色 龙岗做网站 qq网络营销策划 网络安全法与网信工作 山西信息化和信息安全 关于信息安全的图片 成都企业网站建设 手机企业网站设计 石家庄市制作网站公司 信息安全工程中心地址 网络安全法与网信工作 ecshop网站里面有伪静态页面还有部分动态页面不是作弊吧 建网站的公司哪家好 产品网络安全管理流程 网络安全道哥面试阿里 欧美工控系统信息安全事件 信息安全的法规