Build Your First Bootstrap Website with the Basic Template

One thing you will learn when building a Bootstrap website is that the basics of using Bootstrap come down to adding a few lines of code to your HTML. In this excerpt from Bootstrap in 24 Hours, Sams Teach Yourself, you will learn about the basic Bootstrap template as well as a few other sample templates you can use to add more features to your website.

LISTING 3.1 A Simple HTML5 Web Page

To make this a Bootstrap page, you just need to add the Bootstrap CSS (Listing 3.2) to the <head> of the document.

LISTING 3.2 Bootstrap CSS

<link href="css/bootstrap.min.css" rel="stylesheet">

Make sure that the href points to your copy of the Bootstrap CSS file.

But Bootstrap offers more than just CSS. To add all the Bootstrap plugins, you need to add both jQuery and the Bootstrap JavaScript to the bottom of the document. Add the lines in Listing 3.3 to the very bottom of the HTML page, just before the </body> tag.