Outline
[TOC]
1.前言
- bootstrap中外文档:http://v3.bootcss.com/css/
- bootstrap2.3.2:http://getbootstrap.com/2.3.2/
- bootstrap的twitter:http://getbootstrap.com/
- http://www.runoob.com/
2.bootstrap代码获取
2.1 CDN形式:
|
|
- 此外,你还可以使用以下的 CDN 服务:
- 国内推荐使用 : https://www.staticfile.org/
- 国际推荐使用:https://cdnjs.com/
2.2 到官网下载源码
到bootstrap的git官网进入customize进行定制,把需要的功能勾选,然后下载。
3 兼容性
- 为了确保适当的绘制和触屏缩放,需要在
<head>
之中添加 viewport 元数据标签。
|
|
- 在移动设备浏览器上,通过为视口(viewport)设置 meta 属性为 user-scalable=no 可以禁用其缩放(zooming)功能。这样禁用缩放功能后,用户只能滚动屏幕,就能让你的网站看上去更像原生应用的感觉。
|
|
Normalize.css
为了增强跨浏览器表现的一致性,我们使用了 Normalize.css,这是由 Nicolas Gallagher 和 Jonathan Neal 维护的一个CSS 重置样式库。123456How to use normalize.cssFirst, install or download normalize.css from GitHub. There are then 2 main ways to make use of it.Approach 1: use normalize.css as a starting point for your own project’s base CSS, customising the values to match the design’s requirements.Approach 2: include normalize.css untouched and build upon it, overriding the defaults later in your CSS if necessary.
4 布局容器
Bootstrap 需要为页面内容和栅格系统包裹一个 .container 容器。我们提供了两个作此用处的类。注意,由于 padding 等属性的原因,这两种 容器类不能互相嵌套。
4.1 栅格系统
Bootstrap 提供了一套响应式、移动设备优先的流式栅格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列。
- “行(row)”必须包含在 .container (固定宽度)或 .container-fluid (100% 宽度)中,以便为其赋予合适的排列(aligment)和内补(padding)
<div class="col-md-4">.col-md-4</div>
表示占4列
*
超小屏幕 手机 (<768px) | 小屏幕 平板 (≥768px) | 中等屏幕 桌面显示器 (≥992px) | 大屏幕 大桌面显示器 (≥1200px) | |
---|---|---|---|---|
类前缀 | .col-xs- | .col-sm- | .col-md- | .col-lg- |
|
|
5 常用的JS模块
5.1 tooltip工具提示
5.2 popover弹出框
【未完待续】