Bootstrap Interview Questions Part 3

What is Bootstrap breadcrumb?

Breadcrumbs are a great way to show hierarchy-based information for a site. In the case of blogs, breadcrumbs can show the dates of publishing, categories, or tags. They indicate the current page’s location within a navigational hierarchy.

A breadcrumb in Bootstrap is simply an unordered list with a class of .breadcrumb. The separator is automatically added by CSS.

What is pagination in bootstrap and how are they classified?

Pagination is the handling of an unordered list by bootstrap. If you want to handle pagination, bootstrap provides the following classes:

  • .pagination: To get pagination on your page you have to add this class
  • .disabled, .active: Customize links by .disabled for unclickable links and .active to indicate the current page
  • .pagination-Ig, .pagination-sm: Use these classes to get different size item

What are bootstrap alerts and how will you create them?

Bootstrap Alerts provide a way to style messages to the user. They provide contextual feedback messages for typical user actions. You can add an optional close icon to alert. Also, you can add a basic alert by creating a wrapper <div> and adding a class of .alert and one of the four contextual classes.

Bootstrap Interview Questions

How will you create a Bootstrap Dismissal Alert?

You need to follow a few steps to build a dismissal alert:

  • First, you have to add a basic alert by creating a wrapper <div> and adding a class of .alert and one of the four contextual classes.
  • Also add optional .alert-dismissible to the above <div> class.
  • Next, you have to add a close button.
  • Finally, use the <button> element with the data-dismiss = “alert” data attribute.

What are the steps to create a progress bar using bootstrap?

To create a basic progress bar, you need to do the following:

  • Add a <div> with a class of .progress.
  • Next, inside the above <div>, add an empty <div> with a class of .progress-bar.
  • Add a style attribute with the width expressed as a percentage. For example, style = “40%”; indicates that the progress bar was at 40%.

What are the bootstrap media objects?

The media objects are abstract object styles for building various types of components like blog comments, Tweets, etc. It features a left-aligned or right-aligned image alongside the textual content. The goal of the media object is to make the code for developing these blocks of information drastically shorter. And, this goal is achieved by applying classes to some of the simple markups.

Advance Bootstrap Interview Questions

What are the steps to create an animated progress bar using bootstrap?

The steps to create an animated progress bar are as follows:

  • Add a <div> with a class of .progress and .progress-striped. Also add class .active to .progress-striped.
  • Next, inside the above <div>, add an empty <div> with a class of .progress-bar.
  • Add a style attribute with the width expressed as a percentage. For example, style = “60%”; indicates that the progress bar was at 60%.

What do you mean by column ordering in Bootstrap?

Column ordering is one of the most interesting features found in bootstrap. By using appropriate functions, the columns can be written easily and also in a defined order. You can also show them in another column. In order to change or alter the order of the column easily, the functions .col-md-push-* and .col-md-pull-* can be used.

What is the Bootstrap Grid System?

The Bootstrap Grid System is a responsive, mobile-first system that scales up to 12 columns as per the increase in the device or viewport size. The system features predefined classes for easy layout options and powerful mix-ins for generating effectively semantic layouts.

Bootstrap Interview Questions

What Are Bootstrap Media Queries?

Media Queries in Bootstrap allow you to move, show and hide content based on viewport size.  Here is an example to show the basic structure of Bootstrap grid:

<div class = "container"><div class = "row"><div class = "col-*-*"></div><div class = "col-*-*"></div></div> <div class = "row">...</div></div><div class = "container">....

What is Normalize in Bootstrap?

Bootstrap uses Normalize to establish cross-browser consistency.

Normalize.css is a modern, HTML5-ready alternative to CSS resets. It is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements.

What are Bootstrap panels? Explain how to create a Bootstrap panel with a heading.

Bootstrap panel components are used for putting your DOM component in a box. To get a basic panel, simply add .panel and .panel-default classes to the <div> element. There are two ways of adding panel heading to a Bootstrap panel:

  • Use any of the <h1>, <h2>, <h3>, <h4>, <h5>, or <h6> tags with a .panel-title class
  • You can also use the .panel-heading class

Advance Bootstrap Interview Questions

What is the purpose of using the Scroll spy plugin?

The purpose of using the Scroll spy plugin in Bootstrap is that it allows you to target certain sections of the page based on the scroll position. Thereafter, you can add .active classes, based on the scroll position, to the Bootstrap navbar.

Why do we use the affix plugin in Bootstrap?

We use the affix plugin in Bootstrap for affixing a <div> to some certain location on a webpage. The plugin also allows toggling pinning on and off for the affixed <div>. Social icons are the most popular example of using the affix plugin in Bootstrap.

The affixed <div> starts from a particular location on the webpage and scrolls with it. However, after a certain mark, it will be locked in place, thus stopping scrolling with the rest of the webpage.

What is the Bootstrap Panel?

When there is a need for putting the contents in a bordered box with some padding around, the panel components are used. They can be created with the .panel class and content inside the panel consists of a .panel-body class. For creating a basic panel, you need to add class .panel to the <div> element and add class .panel-default to this element.

Bootstrap Interview Questions

What is Button group and which class is used for basic button group?

Button groups allow multiple buttons to be stacked together on a single line. You can use this when you want to place items like alignment buttons together.

For basic button group, .btn-group class is used. Here, you can wrap a series of buttons with class .btn in .btn-group.

What will be the default Bootstrap look of the alert created with this following code:

<div class="alert" role="alert">Warning! I'm missing something.</div>

Alert messages are used to provide feedback message and they usually require the attention of the user. Here it is important to note that Bootstrap Alerts don’t have default class. If a contextual class such as .alert-success, .alert-info, .alert-warning, or .alert-danger, is not provided, a default gray alert will be created.

Why do we need to use Bootstrap? 

Bootstrap provides major benefits to a developer. Some of them include:

bootstrap-bootstrap-interview-questions-edureka
  • It is a free and open-source Web Designing Framework.
  • Bootstrap has the support of all the web browsers like Internet Explorer, Google Chrome, Firefox, Opera, Safari, etc.
  • It is a very powerful mobile first front-end framework.
  • Also, it is very easy to start as one needs to have an idea of HTML and CSS only to work with it.
  • We can design a responsive website through it which adjust to desktop, tablet, and mobile.
  • It comprises functional built-in components which are easy to customize.

Advance Bootstrap Interview Questions

Explain why to choose Bootstrap for building the websites?

There are few reason why we choose Bootstrap for building websites

  • Mobile Support: For mobile devices it provides full support in one single file rather than in separate file. It supports the responsive design including adjusting the CSS based on the different types of device, size of the screen etc. It reduces extra effort for developers.
  • Easy to learn: Writing application in bootstrap is easy if you know CSS and HTML
  • Browser Support: It supports all the popular browsers like Firefox, Opera, Safari, IE etc.

Explain what are class loaders in Bootstrap?

Class loader is a part of JRE (Java Runtime Environment) which loads Java classes into Java virtual environment. Class loaders also does the process of converting a named class into its equivalent binary form.

What are the types of layout available in Bootstrap?

In Bootstrap there are two types of Layout available

  • Fluid Layout: Fluid layout is used when you want to create a app that is 100% wide and use up all the width of the screen
  • Fixed Layout: For a standard screen you will use fixed layout (940 px) option

Bootstrap Interview Questions

Explain what is Bootstrap Grid System?

For creating page layout through a series of rows and columns that house your content Bootstrap Grid Sytem is used.

What are offset columns in Bootstrap?

For more specialized layouts offsets are a useful feature. For more spacing they can be used by pushing column over.

For example, .col-xs=* classes do not support offset but they are easily replicated using an empty cell

What is column ordering in Bootstrap?

Column ordering is one of the feature available in bootstrap and you can easily write columns in an order and show them in another one. With .col-md-push-* and .col-md-pull-*

the order of the column can be easily changed.

Advance Bootstrap Interview Questions

What function you can use to wrap a page content?

To wrap a page content you can use .container and using that you can also center the content.

What is the use of Jumbotron in Bootstrap?

In bootstrap, Jumbotron is generally used for content that you want to highlight like some slogan or marketing headline etc. in other words it is used to enlarge the size of the headings and to add a margin for landing page content

To use the Jumbotron in Bootstrap

  • Create a container <div> with the class of .jumbotron

In Bootstrap what are the two ways you can display the code?

In bootstrap you can display code in two ways

  • <code> tag : If you are going to display code inline, you should use <code> tag
  • <pre> tag: If you want to display the code as a standalone block element or it has multiple lines then you should use <pre> tag

Bootstrap Interview Questions

Explain what are the steps for creating basic or vertical forms?

The steps for creating basic or vertical forms are

  • Add a role form to the parent <form> element
  • Wrap labels and controls in a <div> with class .form-group. To achieve optimum spacing this is needed
  • Add a class of .form-control to all text URL <input> , <text area> , and <select> elements

Explain what is Modal plugin used for in Bootstrap?

A modal is a child window that is layered over its parent window. Using a custom jQuery Plugin, Bootstrap Modal are created. To enrich user experience and to add functionality to users, modal windows are created with the help of Modal plugin.

Explain what is Bootstrap Container?

Bootstrap container is a class which is useful and creates a centered area within the page where our site content can be put within. The advantage of the bootstrap .container is that it is responsive and will place all our other HTML code.

Advance Bootstrap Interview Questions

Explain what is Bootstrap collapsing elements?

Bootstrap collapsing elements enables you to collapse any particular element without writing any JavaScript code or the accordion markup. In Bootstrap to apply collapsing elements you have to add data-toggle= “collapse” to the controller element along with a data-target or ref to automatically assign control of a collapsible element. Likewise, you can use .collapse (options), .collapse (‘show’) or .collapse (‘hide’)

Explain what is list group in Bootstrap and what is the use of it?

List groups are components to display both simple and complex element with custom content

For example, a simple list group is created using class .list-group to address the list, and class .list-group-item to address individual item.

How you can add badge to list group in Bootstrap?

To add badge to list group in Bootstrap you have to simply add <span class = “badge”> within the <li> element.

Bootstrap Interview Questions

Explain what media object in Bootstrap is and what are their types?

Media objects in Bootstrap enables to put media object like image, video or audio to the left or right of the content blocks. Media element can be created using the class .media and the source is specified in using the class .media-object. Media-objects are of two types,

They are of two types

  • .media
  • .media-list

Explain what is Bootstrap well?

Bootstrap well is a container <div> that makes the content to appear sunken or an inset effect on the page. In order to create a well, wrap the content that you would like to appear in the well with a <div> containing the class of .well.

Explain how you can create Nav elements in Bootstrap?

Bootstrap offers various options for styling navigation elements all of them use the same markup and base class .nav.

To create Tabular Navigation or Tabs

  • Start with a basic unordered list with the base class of .nav
  • Then add class .nav-tabs

Advance Bootstrap Interview Questions

What is Twitter Bootstrap?

Bootstrap is a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development. It uses HTML, CSS and JavaScript

Please explain Normalize in Bootstrap

For establishing cross-browser consistency, Bootstrap makes use of Normalize. It is a small CSS file capable of offering better cross-browser consistency in the default styling of HTML elements. Also, Normalize.css is an HTML5-ready and modern alternative to CSS resets.

Can you enumerate the various lists supported by Bootstrap?

Following are the three types of lists supported by Bootstrap:

  • Definition Lists – This type of list allows each list item to have both the <dt> and the <dd> elements. The <dt> denotes definition term, which is the term or phrase being defined. The <dd> element contains the definition for the <dt> element.
  • Ordered Lists – This type of list follows some kind of sequential order. Also, it is prefaced by numbers.
  • Unordered Lists – Traditionally styled with bullets, an unordered list doesn’t follow any particular order. Using the .list-un styled class allows removing the bullets styling from the unordered list. For placing all list items on a single line, the .list-inline class can be used.

Bootstrap Interview Questions

What do you mean by Glyph icons? How do you use them?

Glyph icons are icon fonts that are used in web projects. Although Glyph icons Halflings aren’t free and require licensing in general, they are available free of cost for Bootstrap projects. Add the following code anywhere you wish to use the Glyph icons:

<span class = “glyphicon glyphicon-search”></span>

Note: – For proper padding, it is advised to leave a space between the icon and the text.

Could you explain how to use the Dropdown plugin in Bootstrap?

There are three ways of toggling the dropdown plugin’s hidden content in Bootstrap:

  • With data attributes – Add data-toggle = “dropdown” to some button or link to toggle a dropdown. For example,
<div class = "dropdown">
<a data-toggle = "dropdown" href = "#">Dropdown trigger</a>
<ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel">
...
</ul>
</div>

With JavaScript – Following method is used for calling the dropdown toggle via JS:

$('.dropdown-toggle').dropdown()

Using data-target attribute in place of ref=“#” – If the web browser isn’t enabling JavaScript, then it is better to keep links intact. For this, the data-target attribute is preferred over ref=“#”. For example,

<div class = "dropdown">
<a id = "dLabel" role = "button" data-toggle = "dropdown" data-target = "#" href = "/somepage.html">
Dropdown
<span class = "caret"></span>
</a>
<ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel">
...
</ul>
</div>

Please provide an explanation of input groups in Bootstrap.

 Input groups are simply extended Form Controls in Bootstrap. One can easily append and prepend buttons or text to the text-based inputs using the input groups. Appending and prepending content to an input field allows adding common elements to the user input.

You can append or prepend elements to a .form-control by:

  • Wrapping it in a <div> element with the class .input-group
  • With the same <div> element, put the extra content inside a <span> element with the .input-group-addon class
  • Finally, place the <span> element before or after the <input> element as required

Bootstrap Interview Questions

How will you create a tabbed, pills, and vertical pills navigation menu in Bootstrap?

  1. For creating a tabbed navigation menu
    1. Start with a basic unordered list with the .nav base class
    2. Now, add the .nav-tabs class
  2. For creating a pills navigation menu
    1. Start with a basic unordered list with the .nav base class
    2. Now, add the .nav-pills class
  3. For creating a vertical pills navigation menu
    1. Stack the pills vertically using the .nav-stacked class
    2. Now, add the .nav and .nav-pills classes

What do you understand by the Bootstrap navbar? How will you create one?

One of the most prominent features of Bootstrap, a navbar is a responsive ‘meta’ component that serves as a navigation header for an application or website. There can be several navbars in an application or website.

In mobile views, a navbar collapses and becomes horizontal when the available viewport width increases. The navbar includes styling for basic navigation and site names.

  • Add the .navbar and .navbar-default classes to the <nav> tag
  • Next, add role = “navigation” to the <nav> element
  • Now, add .navbar-header, a header class, to the <div> element. For making the text slightly larger, include an <a> element with the navbar-brand class
  • Add an unordered list with .nav and .navbar-nav classes for adding links to the Bootstrap navbar

Can you explain Bootstrap breadcrumb?

A Bootstrap breadcrumb is a great way to display hierarchy-based information for a website. Simply, it is an unordered list with a .breadcrumb class. CSS automatically adds the separator for a Bootstrap breadcrumb.

In blogs, the breadcrumb can display categories, publishing dates, or tags. It indicates the present page’s location within a navigational hierarchy.

Advance Bootstrap Interview Questions

How do you create and customize thumbnails in Bootstrap?

For creating thumbnails using Bootstrap, add a <a> tag with .thumbnail class around an image. It will add four pixels of padding as well as a gray border. When hovered, an animated glow outlines the image.

You can add any type of HTML content, such as buttons, headings, or paragraphs, into thumbnails. This is how to customize thumbnails using Bootstrap:

  • Change the <a> tag with .thumbnail class to a <div> tag
  • Add anything that you need inside the <div> tag. You can use the default span-based naming convention for sizing

Note: – If you wish to group multiple images then place them in an unordered list. Each list item will be floated to the left.

Please explain Bootstrap alerts. Also, tell how you will create a Bootstrap Dismissal Alert.

 Used for styling messages to the user, Bootstrap Alerts provide contextual feedback messages for typical user actions. To create a Bootstrap Dismissal Alert:

  • Create a wrapper <div> and add a .alert class and one of the 4 contextual classes, namely .alert-danger, .alert-info, .alert-success, and .alert-warning, for adding a basic alert
  • Add the optional .alert-dismissible class to the <div>
  • Next, add a close button
  • Finally, use the <button> element with the data-dismiss = “alert” data attribute
Bootstrap Part 1Bootstrap 2
Back to top