Bootstrap MCQs – Bootstrap Navigation & Layout

21.) How do you center a Bootstrap navbar?

A) .justify-content-center
B) .align-center
C) .navbar-middle
D) .nav-center

Answer: Option A

Explanation: The .justify-content-center class centers the navbar items horizontally.

22.) What Bootstrap class is used to create a navigation bar with equal-width items?

A) .nav-expand
B) .nav-justify
C) .nav-equal
D) .nav-fill

Answer: Option D

Explanation: The .nav-fill class makes navigation links expand to equal widths inside a navigation bar.

23.) How do you add hover effects to a Bootstrap navbar link?

A) .hover-navbar
B) .nav-hover
C) .nav-link:hover { color: red; }
D) .nav-effect

Answer: Option C

Explanation: You can use CSS pseudo-classes (:hover) to add custom hover effects to .nav-link.

24.) What class is used to make a Bootstrap navbar responsive?

A) .navbar-flex
B) .navbar-expand-*
C) .nav-auto
D) .navbar-responsive

Answer: Option B

Explanation: The .navbar-expand-* classes (lg, md, sm) determine when the navbar expands/collapses.

25.) What Bootstrap component is used for navigation between pages in a web application?

A) Pagination
B) Navbar
C) Breadcrumbs
D) All of the above

Answer: Option D

Explanation: Bootstrap provides Breadcrumbs (hierarchical navigation), Pagination (multi-page navigation), and Navbar (main navigation bar).

26.) What Bootstrap class is used to make a navbar fixed at the top?

A) .navbar-fixed-top
B) .navbar-top
C) .fixed-top
D) .navbar-fixed

Answer: Option C

Explanation: The .fixed-top class keeps the navbar fixed at the top of the page.

Leave a Reply

Your email address will not be published. Required fields are marked *