Locked lesson.
About this lesson
Adding Bootstrap to your site is quick and easy.
Quick reference
How to Setup and Use Bootstrap
You can install Bootstrap two different ways.
When to use
Follow these instructions to install and use Bootstrap.
Instructions
There are two ways to install Bootstrap. Manually, or by referencing the files externally.
To reference the files externally, simply add these lines of code to your <head> file.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
You also need to add the following JQuery and Javascript references to your page just above the </body> tag:
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
To install Bootstrap Manually, go to GetBootstrap.com and download bootstrap.
Unzip the file to your desktop.
Navigate into the folder and find the following folders: css, fonts, js.
Press CTRL + A on your keyboard to select all three folder (or press the shift key and down arrow buttons to highlight them all).
Drag and drop the three folders into your C9 directory.
Reference Bootstrap in your HTML file by adding the following to your <head> tag:
<!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]-->
You also need to add the following JQuery and Javascript references to your page just above the </body> tag:
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script>
Hints & tips
- Bootstrap can be installed manually or merely referenced externally on your page.
- I recommend you install it manually.
- Bootstrap is free!
Lesson notes are only available for subscribers.