• 0030 2107517586
  • info@wizdom.gr

How to Build A Simple Website With Bootstrap 5.2.1

How to Build A Simple Website With Bootstrap 5.2.1

How to Build A Simple Website With Bootstrap 5.2.1: Intro and Setup

Bootstrap is a front-end framework that makes it simpler and faster to create mobile-responsive websites. The framework is also totally free, adaptable, and simple. With Bootstrap, you can create intricate web pages from basic HTML and tailor them to your requirements.

 

If you have been looking for a guide on how to create a simple web page with bootstrap 5.2.1, you can get started with our "how to build a simple web page with bootstrap series."

 

In this particular article, you will learn about the tools you need to get bootstrap functioning on your computer.

What You Need To Get Started

Before you start working with the bootstrap framework, you must have a basic knowledge of HTML and CSS. This is because bootstrap uses most of the HTML tags and structures.

 

Again, you will need a code editor. One of the best editors you can use is Visual Studio Code(VSC).

 

Debugging support, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git are among the features.

 

If you have already downloaded and installed it, open your VSC and create a brand-new file. The name of the file for this tutorial is "index.html," though you are free to give it whatever name you like. Also, check to see if your machine has Chrome or Firefox browsers installed.

 

Now you can prepare to create your first code example.

 

<!DOCTYPE html>
<html lang="en">
   <head>
       <meta charset="UTF-8" />
       <meta name="viewport"
             content="width=device-width, initial-scale=1.0" />
       <title> Bootstrap 5.2 </title>
   </head>
   <body>

<h1> A Simple HTML example without Bootstrap Feature yet </h1>


   </body>
</html>

 

The text "A Simple HTML example without Bootstrap Feature yet" will be shown in your local browser when you click the "open in browser" option in your VSC.

 

Note that the functionality of bootstrap is not yet present in the example above. The Bootstrap framework must be included in this code example. There are several ways we can achieve it.

 

  • You choose to download the CSS and JavaScript files, then place them in the project folder.

 

  • You can make use of CDN (Content Delivery Network) bundles, one for JavaScript and one for CSS.

 

  • Additionally, you can use yarn or NPM to install it locally inside our project.

 

We'll employ the CDN to keep things straightforward. Due to CDN's performance advantages, which include faster loading times, we advise including Bootstrap in your project via CDN.

 


MaxCDN:

<!-- Latest compiled and minified CSS -->

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet">

 

<!-- Latest compiled JavaScript -->

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"></script>

 

 

Adding CDN to Our HTML Code Example

<!DOCTYPE html>
<html lang="en">
   <head>
       <meta charset="UTF-8" />
       <meta name="viewport"
             content="width=device-width, initial-scale=1.0" />
       <title> A Simple bootstrap example </title>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet">

 

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"></script>

 


   </head>
   <body>
       <h1> Build a Website With Bootstrap</h1>

 


   </body>
</html>

 

We'll use a tool called live server extension in VSC to preview the code responsively in a browser. Install the live server by typing "live server" into the Packages tab on your VSC.

 

The communication between your browser and the code editor will be responsive if you use a live server. Without opening or reloading your browser, you can immediately see the effects of any adjustments you make or features you add.

 

Note: To see how bootstrap affects the program, first run it without the CDN, then add the CDN and run again.

Conclusion

You learned how to set up your environment for your initial bootstrap code with CDN in this lesson. In subsequent tutorials, you will learn how to use Bootstrap classes and components.

 

Remember that the purpose of this series is to show you how to create a simple responsive web page using the Bootstrap framework.