Bootstrap Interview Questions You Need to Know for 2023 - IQCode

Overview of Bootstrap: Advantages and History

Bootstrap is a toolkit that offers HTML, CSS, and JavaScript tools for web development and design. The project was initiated by Mark Otto and Jacob Thornton and was publicly announced in August 2011 while they were working at Twitter. The goal was to simplify the creation and maintenance of interfaces while making popular design patterns a standard in online design and development.

After its open-source release, Bootstrap became a popular choice among web designers and developers, and for good reason. Its key advantages include responsiveness, wide browser support, reusable components for consistency, simplicity in use, and extensibility through its JavaScript API.


Bootstrap was initially known as Twitter Blueprint, as it was developed by Twitter. However, it was eventually renamed Bootstrap and released as an open-source project. The project's goal was to make popular design patterns a standard in online design and development, and to provide a simple and uniform way to create and maintain interfaces.


Bootstrap provides built-in support for jQuery plugins, as well as a programmatic JavaScript API. This makes it easy to extend and customize Bootstrap functionality using JavaScript. Any IDE or editor, as well as any server-side technology and language, can be used in conjunction with Bootstrap.


Bootstrap offers a set of reusable components that enable the creation of consistent and uniform user interfaces. These components can be customized or combined to create new interfaces, and they are responsive by design, meaning they can adapt to different screen sizes and resolutions. Furthermore, Bootstrap has wide browser support, so its components look and behave similarly across different browsers and devices.

Understanding Bootstrap Container and its Functionality

In the Bootstrap framework, a container is a class that helps in creating a centered and responsive block-level container for content. It is used to wrap the site contents and provide a fixed or fluid layout. A fixed container, using class "container", has a fixed width based on the viewport size; whereas, a fluid container, using class "container-fluid", spans the entire width of the viewport across all device sizes.

The Bootstrap container works by adjusting its width based on the viewport width and size. It adjusts the size of the content based on the screen size of the device and provides a responsive layout. The container class acts like a wrapper, and all the content within the container is centered and aligned properly.

Containers in Bootstrap have a predefined max-width, padding, and margin. This is to ensure that the content in the container is correctly and aesthetically aligned regardless of the screen size. Additionally, Bootstrap also offers a nested container, which gives flexibility to the layout by allowing users to have container elements inside parent containers.

Overall, Bootstrap containers are a powerful tool for creating a responsive and organized website layout that adjusts to various screen sizes.

<div class="container">
   <!-- content goes here-->

<div class="container-fluid">
   <!-- content goes here-->

Default Bootstrap Text Settings

In Bootstrap, the default text is set to 16 pixels and uses the font family of Helvetica Neue, Helvetica, Arial and sans-serif. The default font weight is set to normal and line-height is set to 1.5. These values can be changed by adding custom CSS styles to override the defaults.


The Bootstrap Grid System is a responsive grid system used for designing websites. It is a 12-column grid system that allows designers to create layouts for multiple devices and screen sizes. This system uses a combination of HTML, CSS, and JavaScript to create a flexible and customizable grid layout. It helps designers to arrange website content in an organized and aesthetically pleasing manner. Overall, the Bootstrap Grid System simplifies the process of designing responsive websites.

What are the differences between Bootstrap 4 and Bootstrap 5?

Bootstrap is a popular front-end development framework used to create mobile-first and responsive websites. The latest version of Bootstrap is Bootstrap 5, which was released in May 2021, and it comes with several differences from its predecessor, Bootstrap 4.

Here are some of the major differences between Bootstrap 4 and Bootstrap 5:

1. Smaller File Size: Bootstrap 5 has a smaller file size compared to Bootstrap 4, which means faster loading times and improved website performance.

2. No jQuery Dependency: Bootstrap 5 no longer depends on jQuery, which was a major dependency in Bootstrap 4. This reduces the number of dependencies required to use Bootstrap and makes it more lightweight.

3. New Utility Classes: Bootstrap 5 comes with new utility classes that make it easier to create custom CSS. These utility classes include "gap" and "aspect-ratio".

4. Improved Grid System: Bootstrap 5 has an improved grid system, which provides more flexibility when it comes to creating layouts. You can now nest rows and columns, and use CSS grid for even more customization.

5. New Components: Bootstrap 5 comes with new components, including a datepicker, switch, and range slider, which were not available in Bootstrap 4.

Overall, Bootstrap 5 is a more streamlined and modern framework compared to Bootstrap 4, and it offers developers more tools and flexibility when it comes to building responsive websites.

Understanding the Differences Between Bootstrap 3 and Bootstrap 4

Bootstrap 4 is an upgraded version of Bootstrap 3 and offers several new features and improvements over the previous version. Some key differences between Bootstrap 3 and Bootstrap 4 include:

1. Flexbox: Bootstrap 4 uses Flexbox, which is a powerful layout tool that helps in designing responsive layouts. Bootstrap 3 does not have this feature.

2. Grid System: Bootstrap 4 has a new and updated grid system which is more flexible and customizable than the one in Bootstrap 3.

3. Changes to Class Names: In Bootstrap 4, several class names have been modified or replaced to make them more intuitive and easier to remember.

4. Improved Typography: Typography in Bootstrap 4 has been significantly improved with better font sizes, line heights, and font weights.

5. JavaScript Plugins: Bootstrap 4 offers several new JavaScript plugins, including native support for jQuery 3.x, which is not supported in Bootstrap 3.

Overall, Bootstrap 4 is a more modern and feature-rich framework than Bootstrap 3 and provides developers with more flexibility and customization options.

Understanding Button Groups in HTML

A button group is a set of related buttons in HTML that are designed to function together as a single unit. It is useful when dealing with options or related actions.

The class used for a basic button group in HTML is "btn-group".

Understanding Breadcrumbs in Bootstrap

Breadcrumbs in Bootstrap refer to a type of navigation scheme that identifies the user's current location within a website or application. It typically appears as a horizontal listing of links at the top of a page and shows the hierarchical path to reach the current page. Breadcrumbs are useful for improving the user experience by providing a quick way to backtrack or move to higher-level pages. In Bootstrap, breadcrumbs can be easily implemented using the breadcrumb component from the Bootstrap library.

Using Bootstrap to Create Thumbnails

To create a thumbnail in HTML using Bootstrap, you can use the "thumbnail" class in conjunction with the "img" tag. Simply wrap the "img" tag in a "div" tag with the "thumbnail" class, like so:

<div class="thumbnail">
   <img src="path/to/image.jpg" alt="Thumbnail Image">

You can also add additional elements to the thumbnail, such as a caption, by adding them inside the "div" tag with the "caption" class:

<div class="thumbnail">
   <img src="path/to/image.jpg" alt="Thumbnail Image">
   <div class="caption">
      <h3>Thumbnail Caption</h3>
      <p>Description of thumbnail</p>

You can then style the thumbnail using CSS or additional Bootstrap classes as needed.

Displaying Code in Bootstrap

In Bootstrap, there are two code snippets that can be used for displaying code.

Code snippet 1:

    <!-- Your code goes here -->

This code snippet preserves whitespace and formats the code by wrapping it in a `

` element.

Code snippet 2:
  <!-- Your code goes here -->

This code snippet does not preserve whitespace or format the code, but it can be used inline with other content.

Understanding Flexbox in Bootstrap 4

Flexbox in Bootstrap 4 is a layout system used to arrange and align elements within a container. It allows for flexible and responsive layouts without the need for complex CSS rules. By applying the 'display: flex' property to a container, the child elements can be easily aligned both vertically and horizontally using various flexbox properties such as justify-content and align-items. This makes designing layouts with Bootstrap 4 much simpler and efficient.

Creating Navigation Elements in Bootstrap

To create navigation elements in Bootstrap, you can use the built-in classes and components designed for this purpose. The most common element used for navigation is the navbar. Here's how to create a basic navbar in Bootstrap:

In this example, we're using the




classes to create the basic structure of the navbar. The


class is used to create a button that toggles the visibility of the navigation links when clicked on a small screen, and the


class is used to hide the links by default.

Inside the


div, we have an unordered list


with class


. Each navigation item is represented by a list item


with class


. Each navigation link is created using an anchor element


with class



By default, the first navigation item has the active class. You can add this class to any navigation item to highlight it.

Overall, implementing navigation in Bootstrap is straightforward and highly customizable. You can adjust various attributes and styles to fit your specific needs and design requirements.

Contextual Classes for Styling Panels

In Bootstrap, we can use various contextual classes to style panels, such as








, and


. These classes add different colors to the panels, making them more visually appealing and easier to distinguish from one another. Additionally, we can also add the


class to give the panel a simple, clean look.

Creating an Alert in Bootstrap

To create an alert in Bootstrap, you need to use the "alert" class and one of the contextual classes (e.g. "alert-success", "alert-info", "alert-warning", "alert-danger") to define its color.

Here's an example of how to create a success alert:

<div class="alert alert-success" role="alert">
  This is a success alert.

You can also add additional classes to style the alert as per your requirements. For example, you can add the "alert-dismissible" class to create an alert that can be dismissed by the user.

Here's an example of a dismissible danger alert:

<div class="alert alert-danger alert-dismissible fade show" role="alert">
  <strong>Error!</strong> Something went wrong. Please try again.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>

Make sure to include the Bootstrap CSS and JavaScript files in your HTML document before creating the alert.

Introduction to Bootstrap Card

Bootstrap is a popular front-end framework used to build responsive and mobile-first websites. Bootstrap cards are a flexible and extensible content container that can include headers, footers, images, links, and other elements.

Creating a Bootstrap Card

To create a Bootstrap card, we need to follow these steps:

1. First, include the bootstrap CSS and JavaScript files in the HTML file. 2. Next, create a container element with the `card` class. Inside the container, we can add the card header, body, and footer. 3. The `card-header` class is used to create a header section and `card-footer` class is used to create a footer section. 4. The `card-body` class is used to contain the main content of the card. This can include text, images, and other HTML elements. 5. We can also add additional classes to cards for customization like `border-primary`, `bg-danger` etc.

Here is an example of a basic Bootstrap card:

<div class="card">
  <div class="card-header">
    My Card Header
  <div class="card-body">
    <h5 class="card-title">Card Title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
  <div class="card-footer">
    My Card Footer

This will give us a card with a header, body, and footer containing some sample content. We can further customize the card by adding more classes or editing the content as per our requirement.

Two types of spinners in Bootstrap

Bootstrap provides two types of spinners:

1. **Border spinner**: It consists of a circular border that rotates around to indicate loading. 2. **Growing spinner**: It is a loading animation, where a circle increases its size until the content is loaded.

To create a spinner, use the `.spinner-border` class for the border spinner, and use the `.spinner-grow` class for the growing spinner. These classes can be used in combination with other classes to customize the spinner's appearance.

Bootstrap Input Groups

Bootstrap Input Groups are a way to group and append/attach additional elements to form inputs. The input groups can be used with various types of inputs, such as text, number, email, etc.

Input groups allow developers to add text, buttons, or dropdown menus to inputs, making the UI more user-friendly. Input groups are typically used to enhance search or input forms.

Bootstrap Input Groups consist of a container element that wraps both the original input and the additional appended or prepended elements. This container element has the class "input-group". The additional elements can be placed on either side of the input field, based on the layout design.


<div class="input-group">
  <input type="text" class="form-control" placeholder="Search...">
  <div class="input-group-append">
    <button class="btn btn-secondary" type="button">Search</button>

In the above example, the search input field is wrapped with the input-group container and an appended button is added to the search field.

Bootstrap also provides additional styles for input groups with dropdown menus, checkboxes, and radio buttons. These styles can be applied by adding the appropriate classes to the container element.

Bootstrap Tables and Their Classes

Bootstrap is a popular front-end framework used for web development that provides pre-designed elements like tables, forms, buttons, and more. Bootstrap Tables help in displaying data in an organized and visually appealing manner. Here are the various classes that can be used to customize the appearance of Bootstrap Tables:

- `table` class: This class is used to define a basic table structure.

- `table-striped` class: This class adds zebra-striping to the table rows.

- `table-bordered` class: This class adds borders to all the cells of the table.

- `table-hover` class: This class highlights the table row when the user hovers over it.

- `table-responsive` class: This class makes the table responsive on different screen sizes.

- `thead-dark` class: This class adds a dark background color to the table header.

- `thead-light` class: This class adds a light background color to the table header.

Overall, Bootstrap Tables provide a wide range of customization options for displaying data elegantly.

Example of Basic Toast using HTML and CSS

This is a basic toast message.

Click the button to show the toast:

Overview of Media Objects in Bootstrap

The Media Object is one of the built-in components in Bootstrap that allows you to easily create a media content block with an image and some textual content side by side. It is a powerful tool for creating complex UI layouts with minimal effort. There are two types of Media Objects in Bootstrap:

1. Default Media Object:

The default media object consists of an image, heading, a brief description, and other relevant content. It is perfect for displaying posts, articles, and other similar types of content.

2. Nested Media Object:

The nested media object allows you to create a more complex layout by nesting one media object within another. This is useful when you want to display a comment thread, for example, where each comment contains an image and text.

Overall, Media Objects are a flexible and highly customizable component in Bootstrap that can streamline the process of creating visually appealing content blocks on your website or application.

Implementing a Carousel in Bootstrap

To implement a carousel in Bootstrap, you can use the built-in carousel component. Here are the steps you can follow:

  1. Create a container for the carousel and add the necessary Bootstrap classes. For example:
        <p><div id="myCarousel" class="carousel slide" data-ride="carousel"></p>
  3. Inside the container, create a list of slides, each with an image and caption, like this:
          <p><div class="carousel-inner"></p>
            <p><div class="item active"></p>
              <p><img src="image1.jpg" alt="Image 1"></p>
              <p><div class="carousel-caption"></p>
                <p><h3>Caption 1</h3></p>
                <p><p>This is the caption for slide 1</p></p>
            <p><div class="item"></p>
              <p><img src="image2.jpg" alt="Image 2"></p>
              <p><div class="carousel-caption"></p>
                <p><h3>Caption 2</h3></p>
                <p><p>This is the caption for slide 2</p></p>
  5. Add navigation controls, such as previous and next buttons:
        <p><a class="left carousel-control" href="#myCarousel" data-slide="prev"></p>
          <p><span class="glyphicon glyphicon-chevron-left"></span></p>
          <p><span class="sr-only">Previous</span></p>
        <p><a class="right carousel-control" href="#myCarousel" data-slide="next"></p>
          <p><span class="glyphicon glyphicon-chevron-right"></span></p>
          <p><span class="sr-only">Next</span></p> 
  7. Finally, initialize the carousel with JavaScript:
          <p>// Or with options:</p>
              <p>interval: 2000</p>

With these steps, you can easily implement a basic carousel in Bootstrap. You can customize the layout and behavior of the carousel using additional options and CSS styling.

Bootstrap Interview Questions for Experienced

The Bootstrap Well

is a class in Bootstrap framework that is used to create a container with a gray background color and rounded corners to give it a sunken or inset appearance. It is mostly used to display content in a visually appealing way by adding padding around the content and making it stand out from the rest of the page elements. The size of the well can be adjusted by using the built-in sizing modifiers such as small or large. It is a useful component for creating forms, articles, and other types of content.

About Glyphicons

Glyphicons are a set of icons that are commonly used in web development. They are a set of icons and symbols that can be used to represent different actions, buttons, or navigational elements on a website. Glyphicons can be customized to fit the design and aesthetic of the website, and are commonly used in conjunction with CSS and JavaScript libraries. Overall, Glyphicons are a popular tool for adding visual elements to a website and improving its user interface.

Understanding Bootstrap Pagination and its Classifications

Bootstrap pagination is a user interface element that is used to divide content into separate pages to enhance usability and navigation. It allows users to navigate through different pages of content with ease and is commonly used in web-based applications that deal with a large volume of content.

Bootstrap pagination classes are classified into four main categories based on their functionality and appearance - basic, sizing, alignment and state. The basic category includes the default pagination style, while the sizing category includes larger and smaller sizes. The alignment category includes left, center and right aligned pagination styles, and the state category includes disabled and active pagination states.

To implement Bootstrap pagination in your web application, you can use the pre-built classes and customize them based on your specific needs and design preferences. By incorporating Bootstrap pagination, you can provide your users with a seamless and user-friendly experience when navigating through your website's content.

What are Badges? Which CSS Class can make them look more rounded?

In web development, badges are small visual elements used to display information, such as a count or status indicator. One class that can be used to give badges a more rounded appearance is "badge-pill" from Bootstrap. This class applies rounded corners to both sides of the badge, giving it a pill-like shape.

Column Ordering in Bootstrap

In Bootstrap, column ordering refers to the ability to change the order of columns within a row as per our design requirements. By default, the columns are arranged in the HTML markup in the same order as they appear in the browser, which may not be ideal for certain layouts. The column ordering feature allows us to re-arrange the order of columns by adding the appropriate classes to each column.

For example, we can use the classes "order-first" and "order-last" to move a column to the beginning or end of the row, respectively. Similarly, we can use the classes "order-1", "order-2", etc. to establish a specific order for the columns. These classes can be used in combination with the responsive breakpoint classes to control the column ordering at different screen sizes.

Column ordering is a useful feature in Bootstrap that can help create more flexible and responsive layouts.

Overview of the Affix Plugin

The Affix plugin is a jQuery extension that allows an element to become fixed in its position on the page when the user scrolls past a specified point. It's commonly used for navigation menus to keep them visible as the user moves down the page.

The plugin works by adding or removing a CSS class from the element depending on the user's scroll position. The class to be added or removed is specified in the plugin options.

To use the Affix plugin, simply include jQuery and the plugin script in your HTML file, and call the `affix()` method on the element you want to make affix. You can customize the plugin options to fit your needs, including the offsets for when the element becomes affix or when it stops being affix.

The Affix plugin is a useful tool for improving the user experience on websites with long pages and complex navigation.

Bootstrap Collapsing Elements

Bootstrap collapsing elements are a set of interactive components in the Bootstrap front-end framework that enable users to collapse and expand content on a web page. These elements are commonly used to create collapsible panels, navigation menus, and accordions. When a user clicks on the collapsible element's trigger, either an arrow, button, or link, the content within the element will either collapse or expand, depending on its current state. This provides a more user-friendly experience and helps to optimize screen real estate.

Scrollspy in Bootstrap

In Bootstrap, Scrollspy is a feature that automatically updates the navigation bar highlighting the menu item based on the current scroll position of the page. It allows users to easily navigate to the different sections of a long webpage without having to manually search for them. When a user scrolls down the page, the Scrollspy plugin adds an "active" class to the corresponding navigation menu item. This provides a visual indication to the user of which section of the page they are currently viewing.

Reasons for using Jumbotron in Bootstrap

The Jumbotron is a popular feature in Bootstrap because it allows users to create a large, attention-grabbing header section on their web pages. This feature is commonly used to display important information about a website or to showcase a specific product or service. Additionally, the Jumbotron has a flexible design that can be easily customized to fit a variety of different needs and preferences. Ultimately, the Jumbotron is a valuable tool for designers and developers looking to create visually appealing and engaging web pages.

What are the differences between Tooltips and Popovers?

Tooltips and Popovers are both UI components used to provide additional information to users, but there are some differences between them:

1. Appearance:

Tooltips are typically smaller and simpler than popovers. They usually appear as a short piece of text, while popovers often have more complex layouts and may have images or buttons.

2. Trigger:

Tooltips are usually triggered by hovering over an element, while popovers are often triggered by clicking on an element.

3. Content:

Tooltips usually contain simple text or icons, while popovers can have more detailed information, such as forms or tables.

4. Purpose:

Tooltips are often used to provide quick tips or hints, while popovers are typically used for more detailed information or options.

Classes for Changing Positioning and Closing Settings of Popovers

In order to customize the default settings of popover positioning and closing, you can use the following classes:

1. `popover-placement` - This class can be used to set the desired placement of the popover. You can add this class to the popover element and provide the placement value as the class's attribute. For example: `class="popover popover-placement top"`

2. `popover-dismiss` - This class can be used to specify how the popover should be closed. You can add this class to an element within the popover that should trigger the dismissal. For example: ``

By using these classes, you can easily customize the behavior of popovers according to your requirements.

Properties of Flexbox

Flexbox is a powerful layout tool in CSS that makes it easy to design responsive web layouts. Here are some of the main properties of Flexbox:



: Sets an element as a flexible container. 2.


: Sets the direction of the main axis of the container. 3.


: Aligns items along the main axis. 4.


: Aligns items along the cross axis. 5.


: Determines whether items should wrap or not when they exceed the width of the container. 6.


: Aligns content lines within a multi-line flexible container.

Using Flexbox properties can greatly simplify the process of creating complex layouts that work across different screen sizes and devices. It is important to understand how these properties work and how to use them effectively in web design.

Important Rules for Using Grids in Bootstrap

Using grids in Bootstrap is a very effective way to create responsive layouts for your website. Here are some important rules to follow when using grids in Bootstrap:

1. Always use container class with a row class inside it to create a grid system.

2. Use column classes (such as col-md-4) to define the width of your columns. The total number of columns in a row should be equal to 12.

3. Use the "xs", "sm", "md", and "lg" suffixes to specify different column widths for different screen sizes.

4. Use offset classes (such as col-md-offset-4) to create space between columns.

5. Avoid nesting columns more than 2 levels deep, as it can make the layout difficult to manage.

By following these rules, you can effectively use grids in Bootstrap and create responsive layouts for your website.


After analyzing the data and conducting experiments, it can be concluded that the hypothesis was true.

The results showed a significant correlation between the variables, confirming our initial assumptions. These findings have important implications for the field and can be used to inform future studies and practical applications.

Further research can be conducted to explore other variables that may have an impact on the outcome and to improve the accuracy of our measurements. Overall, this study provides valuable insights into this area of research and opens up new avenues for investigation.

// End of conclusion

Technical Interview Guides

Here are guides for technical interviews, categorized from introductory to advanced levels.

View All

Best MCQ

As part of their written examination, numerous tech companies necessitate candidates to complete multiple-choice questions (MCQs) assessing their technical aptitude.

View MCQ's
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Pleased to see you again

Sign up to unlock all of IQCode features:
  • Master useful skills
  • Improve learning outcomes
  • Share your knowledge
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Master useful skills
  • Improve learning outcomes
  • Share your knowledge
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.