Bootstrap Interview Questions: Grid, Components & Forms

Bootstrap Framework 13 min min read Updated: Nov 16, 2026 Intermediate
Bootstrap Interview Questions: Grid, Components & Forms
Intermediate Topic 2 of 3

Intermediate Bootstrap Interview Questions

1. Why is a .row needed inside a container?

The row uses negative margins to cancel the horizontal padding of the container, so that columns line up exactly with the container edge. It also creates the flex wrapper that holds the columns.

2. What happens if the column numbers in a row add up to more than 12?

The extra columns wrap onto a new line. The grid is flexible, so wrapping is normal and can be used on purpose.

3. What are gutters and how do you change them?

Gutters are the gaps between columns. You change them with g-*, gx-* and gy-* classes on the row, with values from 0 to 5.

4. How do offset and order classes work?

offset-md-3 pushes a column to the right by three column widths. order-* changes the visual order of columns without changing the HTML, for example order-first order-md-last.

5. What is the difference between col, col-auto and col-6?

col shares remaining space equally. col-auto is as wide as its content. col-6 takes exactly 6 of 12 parts.

6. How do you make an equal-height card layout?

Use a row with row-cols-* and add h-100 to each .card, so all cards in a row stretch to the same height.

7. How does the responsive navbar work?

navbar-expand-lg expands the menu on large screens. Below that, the menu is inside .collapse.navbar-collapse and is toggled by a navbar-toggler button with data-bs-toggle="collapse" and a matching data-bs-target.

8. How do you create a modal and open it?

Build .modal > .modal-dialog > .modal-content with header, body and footer, give it an id, and open it with a button that has data-bs-toggle="modal" and data-bs-target="#id". In JavaScript use new bootstrap.Modal(el).show().

9. How do you prevent a modal from closing when the user clicks outside?

Add data-bs-backdrop="static" (and optionally data-bs-keyboard="false") to the modal.

10. How do you make a carousel auto-play?

Add data-bs-ride="carousel" to the carousel container. Set the delay with data-bs-interval in milliseconds. Remember that one carousel-item needs the class active.

11. What is the difference between an accordion and a collapse?

Collapse shows or hides one block. An accordion is a group of collapses connected with data-bs-parent, so opening one closes the others.

12. How does form validation work in Bootstrap?

Bootstrap provides the styles. You use HTML5 attributes like required, add novalidate and needs-validation to the form, check form.checkValidity() in JavaScript on submit and add was-validated so valid and invalid feedback shows.

13. How do you create a floating label?

Wrap the input and label in .form-floating, put the input first with a placeholder attribute and the label after it.

14. Why do tooltips need JavaScript initialization?

For performance reasons, tooltips and popovers are opt-in. You create instances with new bootstrap.Tooltip(element) for each element that has data-bs-toggle="tooltip".

15. What is the difference between a modal and an offcanvas?

A modal appears in the center and blocks the page for a focused task. An offcanvas slides from an edge and is mostly used for menus, filters and carts. Both use a backdrop.

Interview tip: Be ready to write one of these from memory: a three-column responsive grid, a navbar with a toggler, or a modal with a trigger button.

Conclusion

These topics appear in most technical rounds for front-end jobs. Practice by building small components without copying.

Quick Summary: Know grid wrapping, gutters, offsets, navbar, modal, carousel, accordion, form validation and why tooltips need initialization.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators