编译版的所有文件,都按逻辑进行分类,放到了不同的目录中,这些文件可以快速应用于任何web项目。解压下载的压缩包,你可以看到以下目录结构和内容:
bootstrap/
├── css/
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ ├── bootstrap.min.css.map
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ └── bootstrap-theme.min.css.map
├── js/
│ ├── bootstrap.js
│ └── bootstrap.min.js
└── fonts/
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
└── glyphicons-halflings-regular.woff2
以上展示的就是 Bootstrap 的基本文件结构,共包含3个目录:css/、js/、fonts/,分别包含预编译好的CSS、JS和字体文件。预编译文件可以在任何 web 项目中直接使用。
编译版的Bootstrap提供了两种格式的的CSS和JS文件,一种是未经压缩的文件(bootstrap.*),一种是压缩后的文件(bootstrap.min.*)。同时,还提供了 CSS 源码映射表 (bootstrap.*.map) ,可以在某些浏览器的开发工具中使用。
从上述文件结构可以看出,Bootstrap3和Bootstrap2版本有一个很大的区别,就是Bootstrap2版本用于展示 icon 小图标的 .png 图片不见了,取而代之是 fonts目录的 4 种类型的Glyphicons图标字体文件,在 Bootstrap 主题中,使用到了这些图标。该字体来自glyphicons.com 网站,并得到免费授权。
关于作者
歪脖先生,十五年以上软件开发经验,酷爱Web开发,精通 HTML、CSS、JavaScript、jQuery、JSON、Python、Less、Bootstrap等,著有《HTML宝典》、《揭秘CSS》、《Less简明教程》、《JSON教程》、《Bootstrap2用户指南》、《Bootstrap3实用教程》,并全部在 GitHub 上开源。