Bootstrap 4 Getting Started

In this tutorial, you will learn Bootstrap 4 getting started to install, setup, and start using it on your projects.

But, before getting started with Bootstrap 4, you need to use the best HTML editor of your choice to start writing codes fastly. I recommend Notepad++ editor to write Bootstrap 4 codes on your project.

Bootstrap 4 Getting Started

If you need help on installing Notepad++ and executing Bootstrap 4 codes, you can read our guide on how to write HTML code and execute the program.

Follow the step-by-step guide given below to learn how to install and set up Bootstrap 4.

How to Install and Set Up Bootstrap 4 For Getting Started

Here is the step-by-step process you need to follow:-

Step 1: Create a Basic HTML Template

The first step is to open the HTML editor of your choice and create a new HTML template. Start writing the below-given HTML codes to create a basic template for Bootstrap 4.

Test it Live

Step 2: Add Bootstrap 4 <meta> Tag Inside <head> Tag

Bootstrap 4 is a mobile-first and designed for mobile devices to scale according to screen sizes. To ensure proper rendering and touch zooming for all devices, you need to add the given below <meta> tag inside the <head> tag.

Step 3: Add Bootstrap CSS and Javascript Files

There are two methods to add Bootstrap CSS and javascript files to your template. The first method is using CDN and the second method is by downloading files locally.

  • Using CDN
  • By Downloading Bootstrap 4 Library Files Locally

Let’s find out these methods to add Bootstrap 4 library to your starter template.

Method 1: Using CDN

This is the fastest method of adding Bootstrap 4 library files to the basic HTML template. In this method, you need to just add the CDN links on your template to quickly start developing mobile-responsive pages.

Below are the links you can copy and paste to your HTML template:-

1. Copy and Paste Bootstrap 4 CSS CDN Link to <head> Tag

2. Add Bootstrap 4 JS Script CDN Links Before </body> Tag

Let’s find out the second method of adding the Bootstrap 4 library files to your project.

Method 2: By Downloading Bootstrap 4 Library Files Locally

In this method, you need to download the Bootstrap compiled and minified library files to your local system.

First of all, click this link ➔ open the Bootstrap getting started page and click the ‘Download’ button as indicated below.

After that, store the CSS and JS folder inside the folder name ‘bootstrap’.

In addition to this, you also need to download jQuery library and Popper.js to your JS folder under the ‘bootstrap’ folder. To download, click the below links to open them in the new tab.

Further, go to them and right-click the mouse to select Save as… option to download the jQuery library and Popper.js on your local system. After that, move them to the JS folder inside the ‘bootstrap’ folder.

Now, as a result, your Bootstrap library file links are ready to use on your starter HTML template. You need to copy the links given below and paste them to your starter HTML template.

1. Add Bootstrap 4 CSS Link Locally to <head> Tag

2. Add Bootstrap 4 JS Links Locally Before </body> Tag

Note: You can download the Bootstrap 4 library on your local system to install use on your projects. However, all our Bootstrap 4 tutorial examples are based only on CDN links. This is because CDN links are faster to include and quick start Bootstrap 4.

Let’s move further to wrap the content section of the starter template inside the container classes.

Step 4: Wrap Content Inside Container Classes

There are two container classes in Bootstrap 4 given below:-

  • .container
  • .container-fluid

and you need to wrap your content inside the container class of your choice. The above-started template contains only paragraphs (<p>) as the content part. So, its the only content you have to wrap.

Let’s find out this with the examples given below for them:-

Content Inside the .container class (Fixed width container)

Test it Live

OR

Content Inside the .container-fluid class (Full-width container)

Test it Live
Note: You can use any of the container class given above. But, I am using only the .container class here to describe the process of setting up Bootstrap 4.

Step 5: Combine All Together

Test it Live

As a result, the above template becomes the Bootstrap 4 starter template for you to add to your project. You can now save you file in .html extension to make it Bootstrap 4 HTML document.

After that, double click (or right-click and select browser) on it to open and execute on a web browser to see the output.

Next Chapter ➔ Bootstrap 4 Layout >>