Breaking News
Loading...
, ,

Bootstrap-3 tutorial 2 – Installing Bootstrap using a CDN

Share on Google Plus



In this tutorial we’ll be installing Bootstrap using a CDN. Using a CDN is incredibly simple because all we do is place links to the files that we would like to use.


What is a CDN?

CDN stands for “Content Delivery Network” which is a server that hosts commonly used libraries or frameworks. One big advantage of installing Bootstrap using a CDN is that it could boost loading time for your website as the file may have been pre-cached by your users browser by other websites are using the same CDN version.

Where can I find more up to date links to the CDNs?

You might want to get the most up to date versions of both jQuery and Bootstrap from the following links.

Code for this tutorial


<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title> Installing Bootstrap using a CDN </title>

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

  </head>
  <body>

    <button class="btn btn-success" onclick="$(this).hide();"> Click me! </button>

    <!-- JavaScript files should be linked at the bottom of the page  -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  </body>
</html>

You Might Also Like

0 comments

About me


Like us on Facebook