Bootstrap, originally named Twitter Blueprint, was created by Mark Otto and Jacob Thornton as an internal tool in Twitter. It was then later released as an open-source front-end development framework. Since its initial release on 19 August 2011, it has become one of the most popular front-end development frameworks.
Let’s explore some Bootstrap 5 interview questions and how you can answer them.
Bootstrap was created as a solution to bring consistency to their style guide - which is the major advantage of the framework.
Furthermore, Bootstrap is the better option because,
It is mobile-first by default. This means you develop a web application starting from the mobile screen and scaling up to higher resolutions. This ensures that your web application is responsive.
It is easy to get started - if you have a good understanding of HTML and CSS, you can easily get started with Bootstrap.
It has extensive documentation and a huge community behind it to get you any help needed.
Bootstrap is compatible with most major web browsers.
It is highly customizable.
There are other alternatives for Bootstrap like Foundation - but Bootstrap has much cleaner UI elements and is easier to get started and work with than the others.
Bootstrap 5 comes with a lot of improvement from its predecessor. Some of the major changes in Bootstrap 5 are:
Dropped jQuery and now uses vanilla JavaScript
The grid system improved to add a new breakpoint Extra extra large (xxl) with viewports larger than ≥1400px.
Better form controls with better consistency and usability.
Dropped support for Internet Explorer 10 and 11.
Dropped FOnt Awesome and now has a built-in icon set called Bootstrap Icons.
Upgraded from Popper v1.x to Popper v2.x for improved positioning for popovers and tooltips
Bootstrap can be installed in three different ways:
Directly download the compiled and minified CSS and JS files
Using a CDN
Using package installers like npm, yarn, RubyGem, Nuget, and Composer
Before explaining the Grid system we need to understand containers and breakpoints in Bootstrap.
Containers are the basic building blocks that wrap and align the content within them.
Breakpoints define the width of the viewport. They determine how the layout will behave when the screen resolution falls within a range of the breakpoint. There are six default breakpoints starting from Extra small for devices with viewports less than 576px to Extra extra large for devices with viewports larger than 1400px.
The grid system has rows and columns. A container can have multiple rows, and each row divides a container into 12 columns.
An example of how you can create a two-column layout for medium devices is:
Column 1
Column 2
|
A gutter is the gap between two columns in the Bootstrap grid system. Gutters can be horizontal, vertical, or both. The class .gx-* is used to control the horizontal gutter, the class .gy-* is used to control the vertical gutter, and .g-* is used to control both vertical and horizontal gutters.
Containers are the basic building blocks in Bootstrap. Any content within a layout is padded and aligned within a container.
There are three different types of containers.
Default container - .container - in this container class, the max-width changes at each responsive breakpoint.
For example,
|