BS4 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 4 Example
My First Bootstrap Page
Resize this responsive page to see the effect!
Column 1
Lorem ipsum dolor..
Column 2
Lorem ipsum dolor..
Column 3
Lorem ipsum dolor..
Bootstrap Versions
This lesson uses Bootstrap 4, an update to Bootstrap 3 that was launched in 2018 and has additional components, faster stylesheets, increased responsiveness, etc.
The most recent version of Bootstrap, version 5, was released in 2021 and is compatible with the most recent stable versions of all major browsers and platforms. Internet Explorer 11 and lower, however, is not supported.
The primary distinction between Bootstrap 3 and 4 and Bootstrap 5 is that the latter now uses JavaScript in place of jQuery.
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 4?
- Put Bootstrap 4 from a CDN in there.
- Visit getbootstrap.com to get Bootstrap 4.
Bootstrap 4 CDN
Use a CDN (Content Delivery Network) to add Bootstrap 4 if you don’t want to download and host it yourself.
JavaScript and CSS from Bootstrap are supported by CDNs thanks to jsDelivr. Moreover, jQuery must be included:
jsDelivr:
One advantage of using the Bootstrap 4 CDN:
While browsing another website, many visitors have already downloaded Bootstrap 4 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.
jQuery and Popper?
Popper.js and jQuery are used by Bootstrap 4 for JavaScript elements (including tooltips, popovers, modals, etc.). They are not necessary, though, if you only utilize Bootstrap’s CSS component.
Downloading Bootstrap 4
Visit https://getbootstrap.com/, follow the instructions, and download and host Bootstrap 4 yourself.
Create First Web Page With Bootstrap 4
1. Add the HTML5 doctype
The HTML5 doctype is necessary for the use of CSS attributes and HTML elements in Bootstrap 4.
The HTML5 doctype, the lang attribute, and the appropriate character set should always be included at the top of the page:
2. Bootstrap 4 is mobile-first
The responsive design of Bootstrap 4 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:
Two Basic Bootstrap 4 Pages
The code for a simple Bootstrap 4 page (with a responsive fixed width container) is displayed in the example below:
Container Example
Bootstrap 4 Example
My First Bootstrap Page
This is some text.
The code for a simple Bootstrap 4 page (with a full width container) is displayed in the example below:
Container Fluid Example
Bootstrap 4 Example
My First Bootstrap Page
This is some text.