Bootstrap 4 Tutorial

What is Bootstrap?

Bootstrap is a CSS (Cascading Style Sheets) framework, which is used to develop a responsive website. It is an open-source and mobile-first front-end framework. It has design templates that are based on HTML and for typography, buttons, forms, navigation, etc.

Bootstrap is a web framework that aims to make easier and faster development of web pages. It also consists of many Javascript components, which are in the form of jQuery plugins. These plugins provide many other user interface elements like tooltips, dialog boxes, and carousel. 

History of Bootstrap

Bootstrap, previously known as Twitter Blueprint, was developed by Mark Otto and Jacob Thornton as a framework on Twitter to make it compatible with other internal tools. Bootstrap was released as an open-source project on 19 august 2011.

Why use Bootstrap?

Save time - Bootstrap consists of predefined design templates and classes that can be used for saving time and effort.

Responsiveness - Bootstrap helps in developing responsive websites that are automatically adjustable according to the device size.

Browser compatibility - Bootstrap is compatible with almost every browser like Google Chrome, Mozilla Firefox, Internet Explorer, etc.

Open-source – It is an open-source framework, which means it is freely available to everyone.

Bootstrap 4

Bootstrap 4 is the latest version of Bootstrap that consist of new components, new stylesheets, and more responsiveness. The first alpha version of Bootstrap 4 was released on 19 august 2015, and the first beta version was released on 10 August 2017.

Where to get Bootstrap?

There are two ways of using Bootstrap 4; either you can include Bootstrap 4 from CDN (Content Delivery Network) or download Bootstrap 4 from the official site https://getbootstrap.com.

Bootstrap 4 Tutorial

Environment Setup for Bootstrap 4 CDN

CSS (Cascading style sheets)

You have to put the CSS <link> into the <head> tag. The link is givenbelow:-

Compiled and minified CSS

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

JS (JavaScript)

Some components need JavaScript to perform the task. They especially need jQuery, Popper.js, and JavaScript plugins.

You have to place the <script> just before the </body> tag is close. The link is given below:-

jQuery library

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>

Popper JS

<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>

Latest compiled Java Script

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>

Create Web page using Bootstrap 4

  • Add the HTML5 DOCTYPE

Bootstrap 4 needs HTML 5 DOCTYPE because it uses HTML elements and CSS properties.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
</html> 
  • Bootstrap 4 is mobile first

Bootstrap is designed so that websites are responsive on mobile.

<meta name =”viewport” content=”width=device-width, initial-scale=1”>

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap 4 Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  </head>
<body>
  <div class="container">
  <h1>Welcome</h1>
  <p>This  is the first page of Bootstrap</p>
  <p>The .container class provides a responsive fixed width container.</p>          
  </div>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html> 

Output

Bootstrap 4 Tutorial

Bootsrtap Index

Bootstrap 4 Grid

Misc


Related Topics

Bootstrap Time Picker Example

What is a Bootstrap Time picker? It is used to display the time in hours, minutes and seconds from a dropdown menu. In this section, we will create an example to...

4 minutes read.

Bootstrap 4 Margin classes

Bootstrap 4 contains a variety of brief, responsive margin and padding utility classes to change the appearance of an element. The Bootstrap 4 margin classes use for the outer spacing of...

8 minutes read.

Bootstrap 4 Utilities

Bootstrap 4 Utilities Bootstrap 4 utilities also known as helper classes that are used to add more style to the components. Utilities are used to make the website or webpage more stylish or elegant....

10 minutes read.

Bootstrap Typography

Bootstrap provides simple and easily customized typography for headings, body text, lists, and many more. Headline <h1> to <h6> By default, Bootstrap has HTML headings (<h1> to <h6>) that are given below: Example <h1>h1. Bootstrap heading</h1>   <h2>h2. Bootstrap heading</h2>   <h3>h3. Bootstrap heading</h3>   <h4>h4. Bootstrap heading</h4>   <h5>h5. Bootstrap heading</h5>   <h6>h6. Bootstrap heading</h6> Try Now ←...

1 minute read.

Bootstrap With CSS

← Prev Next → ...

1 minute read.

Bootstrap Searchable Dropdown Menu

Searchable Dropdown Menu When we click on the dropdown button/arrow in this dropdown menu, an input field will pop up with all the dropdown items listing inside. If we type in...

5 minutes read.

Bootstrap Datepicker

What is a Bootstrap Datepicker? It is used to display a calendar with the date, month, and time from a dropdown menu. We will use an example to see how the date...

5 minutes read.

Bootstrap 4 Modal

Bootstrap 4 Modal The Modal is a component of Bootstrap 4, which is a dialog box or pop-up window. The modals are used to provide information or warning to the user, such as...

18 minutes read.

Bootstrap Contact Us page

What is a “Contact Us” page? A “Contact Us” page is a web page available on the websites of various companies, organisations etc., for its users to contact the organisation or...

5 minutes read.

Bootstrap 4 Progress Bar

Bootstrap Progress Bar Bootstrap 4 offers progress bars that are used to represent the progress of tasks such as downloading a file, software installation, etc. on the computer. It represents the percentage of the...

9 minutes read.

Bootstrap 4 Form

Bootstrap 4 Forms Bootstrap 4 provides forms, which are one of the essential components for web pages and web applications. It is an input-based component, used to collect user data with the help of...

8 minutes read.

Bootstrap Notification Bubble

What is a notification bubble? Bubbles are built into the Notification system. They float on top of the website or the button to indicate pending notifications. Bubbles can be expanded to reveal...

5 minutes read.

Bootstrap Navigation bar

Navigation Bars In Bootstrap, We can create navigation bar like a navigation header. It is placed at the top of the page. We can collapse or extend it according to screen...

3 minutes read.

Bootstrap 4 navbar

A navigation navbar or navbar uses in every website to make it more user-friendly. Navigating through the website is easier, and the user can instantly search for the topic of...

8 minutes read.

Bootstrap 4 Spinners

Bootstrap 4 offers spinner is a loading indicator that is used to display the loading state of any component or web page. The spinner is also known as a loader...

7 minutes read.

Bootstrap First Example

1) Add HTML5 doctype Before starting the example of Bootstrap, we should know about the some basic rules of Bootstrap. We have to add HTML5 doctype with lang element and CSS properties. <!DOCTYPE html>   <html lang="en">     <head>       <meta charset="utf-8">      </head>   </html> 2) Bootstrap...

2 minutes read.

Bootstrap 4 Grid System

Bootstrap 4 Grid System The bootstrap 4 grid system is used to create a responsive website layout. The bootstrap 4 offers a mobile-first flexbox grid system that allows you to divide...

4 minutes read.

Bootstrap 4 Popover

Bootstrap 4 Popover Popover A popover is similar to the tooltip. The only difference between tooltip and Popover is that in the tooltip, the popup box appears when you move the cursor...

6 minutes read.

Bootstrap 4 Colors

Bootstrap 4 Colors Bootstrap 4 consists of classes that are used to set colors according to the context of the element, and with the help of these classes, we can read...

2 minutes read.

Bootstrap List group

Bootstrap list group provides a group of a list of items. The most basic list is an unordered list. We can use <ul> element with .list-group class and <li> element with .lsit-group-item. Let us see...

3 minutes read.