40+ TOP Bootstrap Interview Questions and Answers
1) Define Bootstrap.
Bootstrap is a front-end framework that is used for creating HTML, CSS, and JS web applications. Its layout is very responsive, easy and fast to use. It mostly focuses on building a mobile application with having design templates for creating UI like Dropdown, Forms, Buttons, Alerts Tab, etc.
2) Why Bootstrap is used for Mobile Web Development?
It is used for Mobile Web development because it has responsive designs and templates which is easy to use.
3) Explain the features of Bootstrap.
Its Features include:
Open Source for use
Compatibility with all browsers.
Easy to use and fast.
4) Define the key components of Bootstrap.
Its components include:
Scaffolding – It has the grid system, background, styles.
JS Plugins – Contains JS and jQuery plugins.
Customize – Can customize frameworks.
CSS – Contains CSS files.
5) What do you understand by Bootstrap container?
Bootstrap container behaves like a container where you can put HTML code and it is a part within the page where the content of the site can be placed to make it responsive and fast.
6) What do you mean by Bootstrap Classloader?
Bootstrap class loader is a part of java and a main parental class of class loader.
7) How many types of layouts are there in Bootstrap?
There are two types of layouts in Bootstrap.
8) Define Fluid Layout.
Fluid Layout is useful when you need to make an app which involves the full width of the screen i.e. Fluid Layout adjusts itself according to the browser size.
9) Define Fixed Layout.
Fixed layout is responsive and easy to use but just like the fluid layout, it cannot adjust itself according to the browser size. Fixed Layout should be 940 px in most cases.
10) How can you display a code in Bootstrap?
You can display the code in two ways i.e. by using the <code>tag and by using the <pre>tag.
11) When will you use <code>tag and <pre>tag?
<code>tag is used to show the code inline and <pre>tag is used to show code with multiple lines.
12) What is a progress bar in bootstrap?
Progress bar is used with HTML tag style in HTML element using <progress> keyword. In bootstrap we used html5 <progress> with CSS classes that have special features in bootstrap, that is only made for the progress bar.
13) Name the contextual classes that are used with the progressive bar in bootstrap.
The contextual classes used with progressive bar are as follows.
14) What are responsive utility classes in Bootstrap?
Responsive utility classes in bootstrap are a set of classes which are used to conceal or exhibit the HTML elements based on screen resolution that discerns by media query in bootstrap.
Example: “hidden-md-down”, It hides
15) What are the different button styles in Bootstrap?
In bootstrap there are seven styles which we can use with the bootstrap button.
16) What are Bootstrap alerts?
This is used to create presume alert messages, which adds style to the messages to look more noticeable to the user.
There are four classes in alerts i.e .alert-success, .alert-info, .alert-warning, .alert-danger.
17) Define Bootstrap thumbnails.
It is a way to use the layout images, videos, text etc. in a grid system. We can create thumbnails by adding a tag with the class .thumbnails around the image.
This will add four pixels of padding and a grey border.
18) Explain Modal plugin in Bootstrap.
A model is an inherited window that is layered over its parent window. This is used to augment the user experience and adds different functionalities to the users.
Model windows are created with the help of the modal plugin.
19) Which class is used for pagination in Bootstrap?
To add pagination on the webpage we have to use the class .pagination.
20) Explain what is Bootstrap collapsing elements.
To use this feature in bootstrap you have to add data-toggle=” collapse” to the controller element along with a data target to automatically assign the control of a collapsible element. We can use this by writing .collapse(options) etc.
21) What is Bootstrap Well?
Bootstrap well is a form of container which thrives or makes the content to look recessed on the web page. It also wraps the content by using .well class.
22) Explain the uses of carousel plugin in Bootstrap.
Carousel plugin in bootstrap is used to make sliders in the web pages or your site. There are several carousel plugins that are used in bootstrap to display large contents within a small space by adding sliders.
Example: .carousel(options), .carousel(‘pause’), .carousel(cycle’), .carousel(‘prev’), .carousel(‘next’).
23) What will be the output of the below code and why?
<div class=”progress-bar progress-bar-success” style=”width: 65%”>
<span class=”sr-only”>75% successfully completed</span>
<div class=”progress-bar progress-bar-warning” style=”width: 20%”>
<span class=”sr-only”>30% completed with warnings</span>
<div class=”progress-bar progress-bar-danger” style=”width: 15%”>
<span class=”sr-only”>15% did not complete</span>
If we place multiple bars with the same .progress parent element, Bootstrap will pile them into one single progress bar. As we know, in bootstrap the sum of the progress bar is 100 %. So, the progress bar will give the result as full width and fully populated.
24) How can we customize links of pagination in Bootstrap?
We can customize the links by using .disabled for unclickable links and .active for indicating the current page.
25) Explain input group in Bootstrap.
Input group in bootstrap are put out from controls. By using an input group, we can easily add prepended and appended text or button to the text-based inputs.
We can prepend and append elements to a .form-control by taking all the elements in a <div> under a class .input-group. After that, place your extra content inside a <span> in same <div> by using class .input-group-addon after this you can place the <span> element either before or after the input element.
26) Write the ways to create a tabbed navigation menu in Bootstrap.
We can create a tabbed navigation by making a basic unordered list with the base class of .nav and after this, we can add class .nav-tabs.
27) In Bootstrap, how can you create a pills navigation menu?
Pills navigation menu in bootstrap is created by making an unordered list at first with the base class of .nav and after this add the class .nav-pills.
28) How navbar works in Bootstrap?
In bootstrap, navbar is an eminent feature to make responsive meta component that works as navigation headers for your application and site. In mobile view, navbar collapses and become horizontal as the available viewport width increases.
29) How we can create a navbar in Bootstrap?
To create a navbar in a bootstrap at first, we have to add the classes .navbar, .navbar-default to the <nav> tag. After this, we have to add the role=”navigation” to the above element, and this will help in accessibility.
We have added a header class .nav-header to the <div> element, which will include an <a> element with a class navbar brand. From this, we will get a text with a larger size.
30) What is Bootstrap breadcrumb?
Bootstrap breadcrumb is an efficient way to show hierarchy-based information for a site. This can show the dates of publishing, categories or tags in a blog. They also tell the user about the current page location within a navigational hierarchy.
So we can say that Bootstrap breadcrumb is simply an unordered list with a class of .breadcrumb.
31) What are labels in Bootstrap?
Bootstrap labels are used for offering counts, tips or other things to provide markup on web pages. To use the label in Bootstrap we use the class .labels to indicate the labels.
32) What are badges in Bootstrap?
Badges are homogeneous to labels, the main difference between them is corners are more rounded. The main work of badges in the bootstrap is to highlight new or unread items. To use badges just add <span class=”badge”> to links and bootstrap navs.
33) What is a jumbotron in Bootstrap?
It is used to increase the size of headings and to add a lot of margins for landing page content. To create a jumbotron we have to create a container <div> with the class of .jumbotron.
34) How can we make image responsive in Bootstrap?
After the updates in Bootstrap, currently the feature to make an image responsive has been added, we can do this by adding a class .img-responsive to the <img> tag. This class makes the width max-width =100%; and height=auto; to the image so that it matches nicely to the parent element.
35) What do you mean by normalize in Bootstrap?
Bootstrap normalize is a small CSS file which is used to make cross-browser consistency.
36) What is lead body copy in Bootstrap?
It is used to add some ascent to the paragraph if we add class=”lead”. This will enlarge the font size and a taller line height.
37) What are panels in Bootstrap?
Panels are components that are used when you want to put your DOM component in a box. So, to retrieve a basic panel we just need to add class.panel to the <div> element. We can also add class.panel-default to this element.
38) How will you create a Bootstrap panel with heading?
There are two ways by which we can add panel heading.
First is, we can directly use .panel-heading class to add heading container in a panel and the second way is by using any heading tag like <h1> to <h6> with a .panel-title class to give more styles on the heading.
39) What is a scrollspy plugin in Bootstrap?
It is an auto-updating nav plugin which allows in fetching section of the page based on the scroll position. This can be done by the .active class to the navbar based scroll position.
40) What is the work of affix plugin in Bootstrap?
This plugin allows a <div> to be attached to a location on the page.
Use of the social icon in a page is an example for this in which we see that the icons will start in a location, but when the page hits on a certain mark it will block the <div> in place and will stop the scrolling for rest of the page.