Before we can get started with Bootstrap, we first need to download its source files. At the time of writing this book, Bootstrap was at Version 3.1.1. You can download the latest version from http://getbootstrap.com.
The zip archive contains the following three folders:
css
fonts
js
Do not be alarmed with the amount of files inside the css
folder. This folder contains four .css
files and two .map
files. We would only need to include the bootstrap.css
file in our project for the Bootstrap styles to be applied to our pages. The bootstrap.min.css
file is simply a minified version of the aforementioned file.
The .map
files can be ignored for the project we'll be creating. These files are used as a type of debug symbol (similar to the .pdb
files in Visual Studio), which allow developers to live edit their preprocessor source files—something which is beyond the scope of this book.
Bootstrap uses Font Awesome to display various icons and glyphs in Bootstrap sites. Font Awesome was designed specifically for Bootstrap and the fonts
folder contains the following four different formats of the font files:
Embedded OpenType (
glyphicons-halflings-regular.eot
)Scalable Vector Graphics (
glyphicons-halflings-regular.svg
)TrueType font (
glyphicons-halflings-regular.ttf
)Web Open Font Format (
glyphicons-halflings-regular.woff
)
It is a good idea to include all these files in your web project as this will enable your site to display the fonts correctly in different browsers.
The js
folder contains two files. All the Bootstrap plugins are contained in the bootstrap.js
file. The bootstrap.min.js
file is simply a minified version of the aforementioned file. Before including the file in your project, make sure that you have a reference to the jQuery library because all Bootstrap plugins require jQuery.
The default project template automatically adds the jQuery library to your project and creates a bundle for it. The jQuery bundle will be included in your pages if you have the following line of code inside your view:
@Scripts.Render("~/bundles/jquery")
Tip
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.