Hello World with the Bootstrap Web UI Framework

The instructions below can be followed to build and run a minimal web page using Bootstrap. Bootstrap is a free and open source web UI development framework originally created by developers working at Twitter.

(To be honest, there’s not much to this post at the moment. When I tried to do a more complicated example than Hello World, the layout stopped working as expected. Nonetheless, I’ll post what I have for future reference.)

1. In any convenient location, create a new directory named “BootstrapTest”.

2. Download the package for Bootstrap into the newly created BootstrapTest directory. As of this writing, the latest version is available for download as a .zip file at the URL “https://getbootstrap.com/”.

3. Extract the contents of the downloaded .zip file using any convenient .zip extraction utility, and rename the resulting directory to “bootstrap”.

4. In the BootstrapTest directory, create a new text file named “BootstrapTest.html”, containing the following text. This code is minimally adapted from a sample found on the official Bootstrap site at the URL “https://getbootstrap.com/”.


<!-- This code is minimally adapted from a sample -->
<!-- found on the official Bootstrap site -->
<!-- at the URL https://getbootstrap.com. -->

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="bootstrap/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]-->
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- 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="bootstrap/js/bootstrap.min.js"></script>
  </body>
</html>


5. Open the BootstrapTest.html file created in the previous step in a web browser that runs JavaScript. Verify that the message “Hello, World” appears.

Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s