BS5 Get Started
What is Bootstrap?
- A free front-end framework called Bootstrap makes web development quicker and simpler.
- In addition to optional JavaScript plugins, Bootstrap offers HTML and CSS based design templates for modals, image carousels, forms, buttons, tables, navigation, and many other uses.
- Additionally, Bootstrap makes it simple to construct responsive designs.
What is Responsive Web Design?
The goal of responsive web design is to build websites that appear well on all screen sizes, from giant computers to little phones.
Bootstrap 5 Example
My First Bootstrap Page
Resize this responsive page to see the effect!
Column 1
Lorem ipsum dolor sit amet, consectetur adipisicing elit...
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...
Column 2
Lorem ipsum dolor sit amet, consectetur adipisicing elit...
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...
Column 3
Lorem ipsum dolor sit amet, consectetur adipisicing elit...
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...
Bootstrap Versions
The most recent iteration of Bootstrap, launched in 2013, is called Bootstrap 5 (released in 2021); it features new components, a quicker stylesheet, and more responsiveness.
The most recent, stable versions of all the major browsers and systems are supported by Bootstrap 5. Internet Explorer 11 and lower, however, is not supported.
The primary distinction between Bootstrap 3 and 4 and Bootstrap 5 is that the latter has moved from jQuery to vanilla JavaScript.
Note: It is safe to keep using Bootstrap 3 and Bootstrap 4 since the team continues to support them for important bugfixes and documentation updates. They won’t, however, get any further features.
Why Use Bootstrap?
Benefits of using Bootstrap:
Easy to use: Anyone may begin using Bootstrap with only a basic understanding of HTML and CSS.
Responsive features: The responsive CSS of Bootstrap adapts to computers, tablets, and phones.
Mobile-first approach: Mobile-first styles are included into the basic structure of Bootstrap.
Browser compatibility: All current browsers (Chrome, Firefox, Internet Explorer 10+, Edge, Safari, and Opera) are compatible with Bootstrap 4.
Where to Get Bootstrap 5?
To begin utilizing Bootstrap 5 on your own website, there are two methods.
One may:
- Put Bootstrap 5 from a CDN in there.
- Get Bootstrap 5 by visiting getbootstrap.com.
Bootstrap 5 CDN
It is possible to incorporate Bootstrap 5 from a CDN (Content Delivery Network) if you do not wish to download and host it yourself.
CDN support for Bootstrap’s JavaScript and CSS is offered by jsDelivr:
MaxCDN:
One advantage of using the Bootstrap 5 CDN:
While browsing another website, many visitors have already downloaded Bootstrap 5 from jsDelivr. When people visit your site, it will therefore load from cache, which speeds up loading times. Faster loading times are also achieved by most CDNs, which guarantee that a file requested by a user will be provided from the server nearest to them.
JavaScript?
JavaScript is used by Bootstrap 5 for a variety of components, including tooltips, popovers, and modals. They are not necessary, though, if you only utilize Bootstrap’s CSS component.
Downloading Bootstrap 5
Visit https://getbootstrap.com/, follow the instructions, and download and host Bootstrap 4 yourself.
Create Your First Web Page With Bootstrap 5
1. Add the HTML5 doctype
The HTML5 doctype is necessary for the use of CSS attributes and HTML elements in Bootstrap 5.
Always start a page with the HTML5 doctype, the lang attribute, the appropriate title, and the appropriate character set:
Bootstrap 5 Example
2. Bootstrap 5 is mobile-first
The responsive design of Bootstrap 5 is intended for mobile devices. Mobile-first styles are integrated into the main structure.
Within the <head> element, add the following <meta> tag to guarantee appropriate rendering and touch zooming:
The width of the page is set to follow the device’s screen width (which varies based on the device) by using the width=device-width component.
When the browser loads the page for the first time, the initial zoom level is determined by the initial-scale=1 component.
Two Basic Bootstrap 5 Pages
The code for a basic Bootstrap 5 page (with a responsive fixed width container) is displayed in the example below:
Container Example
Bootstrap Example
My First Bootstrap Page
This part is inside a .container class.
The .container class provides a responsive fixed width container.
The code for a basic Bootstrap 5 page (with a full width container) is displayed in the example below:
Container Fluid Example
Bootstrap Example
My First Bootstrap Page
This part is inside a .container-fluid class.
The .container-fluid class provides a full width container, spanning the entire width of the viewport.