Bootstrap CDN
How to Use Bootstrap
There are two ways to start using Bootstrap on your own web site.
- Download Bootstrap from getbootstrap.com.
- Include Bootstrap from a CDN.
Downloading Bootstrap
If you want to download and host Bootstrap yourself, go to getbootstrap.com, and follow the instructions there.
Bootstrap CDN
If you don't want to download and host Bootstrap yourself, you can include it from a CDN (Content Delivery Network).
MaxCDN provides CDN support for Bootstrap's CSS and JavaScript. You must also include jQuery:
Place bootstrap CDN link between <head> and </head>.
Bootstrap CDN
<!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <!-- Latest compiled JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Advantage of using the Bootstrap CDN
Many users already have downloaded Bootstrap from MaxCDN when visiting another site. As a result, it will be loaded from the cache when they visit your site, which leads to faster loading time. Also, most CDN's will make sure that once a user requests a file from it, it will be served from the server closest to them, which also leads to faster loading time.
Use Bootstrap
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <h1>My First Bootstrap Page</h1> <p>This is some text.</p> </body> </html>
Output
My First Bootstrap Page
This is some text.