BS Home

Note : Include this code if you don’t see doctype code, otherwise the bootstrap will not work

See the Pen example 1 by Training Course (@Training-Course) on CodePen.

Introduction To Bootstrap

Bootstrap is a free tool that helps people make websites that work well on all devices, like mobile phones, tablets, and computers. It uses HTML, CSS, and JavaScript to design websites easily. Bootstrap has ready-made designs, like buttons, forms, and menus, which help in making websites quickly and easily.

What is Bootstrap?

Bootstrap is a useful tool that helps people make websites quickly and easily. It provides ready-made designs using HTML and CSS for things like buttons, forms, menus, pop-up messages, slideshows, and more. With Bootstrap, websites can change their layout to fit different screen sizes, like mobiles, tablets, and computers, without much hard work.

Why Learn Bootstrap Basics?

Ease of Use: Even with basic knowledge of HTML and CSS, you can start using Bootstrap to design websites.
Responsive Design: Bootstrap’s responsive CSS adjusts your website’s layout to look good on phones, tablets, and desktops.
Mobile-First Approach: Bootstrap is designed with a mobile-first philosophy, ensuring your website performs well on mobile devices.
Browser Compatibility: Bootstrap is compatible with all modern browsers, including Chrome, Firefox, Internet Explorer, Edge, Safari, and Opera.

Course Overview

In this course, you’ll learn:

– The fundamentals of Bootstrap and its grid system.
– How to use Bootstrap components like navbars, buttons, and forms.
– Customizing Bootstrap themes to fit your style.
– Building a responsive website from scratch using Bootstrap.

We’ll start with the basics, gradually moving to more complex concepts, ensuring a solid understanding of how to effectively use Bootstrap in your projects. By the end of this course, you’ll be equipped with the knowledge and skills to create visually appealing, responsive websites with ease.

Ready to dive into the world of responsive web design with Bootstrap? Let’s get started!

Get Started

This page will help you begin learning Bootstrap. You will learn how to set it up, understand the basics, and see a simple example to start your journey. This will make it easy for you to create good-looking and mobile-friendly websites.

Getting Started with Bootstrap

Welcome to the first step in learning Bootstrap! This section will help you set up Bootstrap in your project and understand its basic structure. By the end, you will be able to create a simple webpage using Bootstrap.

When teaching how to download Bootstrap, it is important to explain the different ways to get it and how to use it in a project. Here’s how you can learn and follow the steps easily.

Downloading and Setting Up Bootstrap

Bootstrap is a useful tool that helps make websites look good and work well. You can add Bootstrap to your website in different ways. This section will show you how to download and set up Bootstrap easily.

Methods to Include Bootstrap

1- Using a CDN (Content Delivery Network)

– Fastest and Easiest Method: Using a CDN allows you to include Bootstrap without downloading any files. Simply add the following lines to the `<head>` of your HTML document:

<!– Bootstrap CSS –>
<link rel=”stylesheet” href=”https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css”>
<!– Bootstrap JavaScript Bundle (Includes Popper) –>
<script src=”https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/js/bootstrap.bundle.min.js”></script>

Advantages:

– No need to download and host Bootstrap files.
– Benefits from CDN’s caching and fast delivery.

2- Downloading Bootstrap Files

Direct Download: Go to Bootstrap’s official website and download the latest version. You’ll get a zip file with CSS, JS, and other files.

Setup:

•  Extract the downloaded zip file.
  Copy the CSS and JS files into your project directory.
  Link these files in your HTML file’s `<head>` section like so:

    <!– Bootstrap CSS –>

    <link rel=”stylesheet” href=”path/to/bootstrap.min.css”>

    <!– Optional: Bootstrap JavaScript Bundle –>

    <script src=”path/to/bootstrap.bundle.min.js”></script>

3- Using Package Managers

– npm:

  – Install Node.js and npm (Node Package Manager).

  – Run `npm install bootstrap` in your project directory.

– Yarn:

  – Install Yarn package manager.

  – Run `yarn add bootstrap` in your project directory.

– Setup:

– After installation, link to the Bootstrap files located in the `node_modules` folder.

4- Using a Build Tool (like Webpack)

Advanced Method:
For those using build tools like Webpack, you can import Bootstrap directly into your JavaScript file.

Installation:
Use npm or Yarn to add Bootstrap to your project.

Usage:
In your main JavaScript file, add:

    import ‘bootstrap’;

    import ‘bootstrap/dist/css/bootstrap.min.css’;

The various methods of downloading and integrating Bootstrap into a web project. It caters to different levels of users, from beginners to those more experienced with web development tools and package managers.

Basic Template

Here’s a basic Bootstrap template. Copy this into an HTML file to start:

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Bootstrap Example</title>
<link rel=”stylesheet” href=”https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css”>
</head>
<body>
<h1>Hello, world!</h1>
<script src=”https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/js/bootstrap.bundle.min.js”></script>
</body>
</html>

See the Pen Get Started by Training Course (@Training-Course) on CodePen.

Understanding the Basics

The Grid System

Bootstrap uses a grid system for layout. The system is based on 12 columns, allowing you to create responsive and flexible layouts. For example, to create a three-column layout, you would use something like this:

<div class=”container”>
<div class=”row”>
<div class=”col”>
Column 1
</div>
<div class=”col”>
Column 2
</div>
<div class=”col”>
Column 3
</div>
</div>
</div>

See the Pen system by Training Course (@Training-Course) on CodePen.

Responsive Design

Bootstrap’s responsive design adjusts to different screen sizes. This is achieved through a series of media queries and a mobile-first approach.

Your First Bootstrap Page

Let’s put this into practice. Replace the `<h1>` tag in your basic template with the following Bootstrap navbar component:

<nav class=”navbar navbar-expand-lg navbar-light bg-light”>
<a class=”navbar-brand” href=””>Navbar</a>
<button class=”navbar-toggler” type=”button” data-toggle=”collapse” data-target=”navbarNav” aria-controls=”navbarNav” aria-expanded=”false” aria-label=”Toggle navigation”>
<span class=”navbar-toggler-icon”></span>
</button>
<div class=”collapse navbar-collapse” id=”navbarNav”>
<ul class=”navbar-nav”>
<li class=”nav-item active”>
<a class=”nav-link” href=””>Home <span class=”sr-only”>(current)</span></a>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=””>Features</a>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=””>Pricing</a>
</li>
</ul>
</div>
</nav>

See the Pen Your First Bootstrap Page by Training Course (@Training-Course) on CodePen.

This gives you a functional, responsive navigation bar. Try resizing your browser window to see how it adapts. Congratulations on setting up your first Bootstrap page! You’ll dive deeper into Bootstrap’s components, layout options, and customization techniques from here. Stay tuned!

Container

This gives you a functional, responsive navigation bar. Try resizing your browser window to see how it adapts. Congratulations on setting up your first Bootstrap page! You’ll dive deeper into Bootstrap’s components, layout options, and customization techniques from here. Stay tuned!

What is a Container?

A Bootstrap container is essentially a “wrapper” used to encapsulate and align your content within a webpage. Think of it as a bounding box that houses your content and the grid system. It’s the first step in using the Bootstrap grid and is crucial for proper alignment and spacing of your HTML elements.

Why Are Containers Important?

1. Proper Alignment and Spacing:

Containers help to keep your content in the center and add proper space around it, making your webpage look neat.

2. Makes Websites Fit All Screens:

They help your website look good on all screen sizes, whether it’s a small mobile phone or a big computer screen.

3. Helps in Creating Layouts:

Containers are needed when using Bootstrap’s grid system, which helps in arranging content in a structured way.

Types of Containers in Bootstrap

Bootstrap has three types of containers, and each one has a different use.

1. .container (Fixed-Width Container)

•  What it does: It creates a box that has a fixed maximum width but adjusts according to the screen size.
  How it behaves: The container’s width changes at different screen sizes to fit properly.
  When to use it: Use this when you want a neat layout that doesn’t stretch too much but still adjusts for different devices.

Example of .container

<div class=”container”>
<p>This content is inside a .container, which means its width will change at different breakpoints.</p>
</div>

See the Pen 1.container by Training Course (@Training-Course) on CodePen.

2. .container-fluid (Full-Width Container)

•  What it does: It creates a container that takes up the full width of the screen.
•  How it behaves: It always stays 100% wide, no matter the screen size.
•  When to use it: Use this when you want a layout that stretches from one edge of the screen to the other, like full-width image sliders.

Example of .container-fluid

<div class=”container-fluid”>
<p>This content is inside a .container-fluid, which means it will always take up 100% of the viewport’s width.</p>
</div>

See the Pen Example of .container-fluid by Training Course (@Training-Course) on CodePen.

3. .container-{breakpoint} (Responsive Fixed-Width Container)

•  What it does: It creates a container that is full-width on small screens but has a fixed width on larger screens.
•  How it behaves: Below a certain screen size, the container takes up the full width. But when the screen gets bigger, it stays at a fixed width.
•  When to use it: Use this when you want a responsive layout that looks wide on small screens but neat and centered on bigger screens.

Classes Bootstrap Grid System X-Small 576px Small 576px Medium 768px Large 992px X-Large 1200px XX-Large 1400px
.container 100% 540px 720px 960px 1140px 1320px
.container-sm 100% 540px 720px 960px 1140px 1320px
.container-md 100% 100% 720px 960px 1140px 1320px
.container-lg 100% 100% 100% 960px 1140px 1320px
.container-xl 100% 100% 100% 100% 1140px 1320px
.container-xxl 100% 100% 100% 100% 100% 1320px
.container-fluid 100% 100% 100% 100% 100% 100%

Example of .container-md

<div class=”container-md”>
<p>This content is inside a .container-md. It’s full-width on small screens but adopts a max-width on medium screens and above.</p>
</div>

See the Pen Example of .container-md by Training Course (@Training-Course) on CodePen.

Conclusion

Bootstrap is a simple and powerful tool that helps make websites look good on all screen sizes.

•  .container keeps the content in a fixed-width box that adjusts to the screen size.
•  .container-fluid makes the content spread across the whole screen.
•  .container-{breakpoint} changes the width based on the screen size, making websites look neat on all devices.

By learning Bootstrap, you can quickly create good-looking, mobile-friendly websites without much hard work. Keep practicing, and you’ll soon be able to design great web pages easily!

Frequently Asked Questions

Still have a question?

Let's talk

Yes, our Bootstrap Online Training is 100% free of cost! We believe in providing high-quality education without any barriers, so you can learn Bootstrap and responsive web design without worrying about fees or subscriptions. Start your learning journey today at no cost!

Bootstrap is a powerful front-end framework that simplifies web development by offering ready-to-use components for responsive web design. Learning Bootstrap allows you to design mobile-first, responsive websites quickly and efficiently, improving both productivity and design consistency.

The training will cover essential Bootstrap basics, including its grid system, responsive layout, components (like buttons, forms, modals), and how to implement these features to create modern web applications.

While prior knowledge of HTML and CSS is helpful, it is not mandatory. The Learn Bootstrap Basics training is designed to teach beginners the fundamental concepts, and you will be guided step-by-step to integrate Bootstrap into your web development projects.

Bootstrap accelerates the web development process by providing pre-built components and a flexible grid system. It enables you to focus on functionality while ensuring your websites are responsive, compatible across devices, and visually appealing.

Bootstrap’s responsive design features ensure your website looks great on all devices, from desktops to mobile phones. The grid system and built-in components adapt to different screen sizes automatically, saving you time and effort in making your site mobile-friendly.

Absolutely! Bootstrap is not only for simple sites but can also be used to create complex web applications. Its modular nature allows for easy customization, making it a versatile tool for developers of all skill levels.

The duration of the course depends on your learning pace. Typically, it takes a few weeks to cover the entire curriculum, but you can learn at your own speed and revisit the material as needed.

Before Learn Bootstrap Basics, it is recommended that you have a basic understanding of HTML and CSS. If you’re new, we offer additional resources to help you get started with these technologies.