FROM GOOGLE GEMINI:
Bootstrap (CSS Framework) Multiple Choice Questions and Answers
Q1. What is Bootstrap primarily used for?
A) Back-end database management
B) Responsive, mobile-first front-end web development
C) Server-side scripting
D) Native mobile application compilation
Answer: B) Responsive, mobile-first front-end web development
Q2. Which company originally developed Bootstrap?
A) Google
B) Microsoft
C) Twitter
D) Meta
Answer: C) Twitter
Q3. How many columns make up the standard Bootstrap grid system?
A) 8
B) 10
C) 12
D) 16
Answer: C) 12
Q4. Which CSS preprocessor is used to build Bootstrap source code?
A) Less
B) Sass
C) Stylus
D) PostCSS
Answer: B) Sass
Q5. Which class is used to wrap page content with a responsive fixed-width container in Bootstrap?
A)
.container-fixedB)
.containerC)
.wrapperD)
.layout-box
Answer: B) .container
Q6. Which class allows a Bootstrap container to span the entire width of the viewport?
A)
.container-fullB)
.container-wideC)
.container-fluidD)
.container-screen
Answer: C) .container-fluid
Q7. In Bootstrap 5, which prefix is used for left/right directional utility classes (like margins and paddings) to support RTL layouts?
A)
landr(for left and right)B)
sande(for start and end)C)
bandf(for beginning and finish)D)
flandfr(for float-left and float-right)
Answer: B) s and e (for start and end)
Q8. Which class is used to make an image responsive so that it scales nicely to the parent element?
A)
.img-responsiveB)
.img-fluidC)
.image-scaleD)
.img-scaled
Answer: B) .img-fluid
Q9. Which class combination creates a primary styled button in Bootstrap?
A)
btn btn-primaryB)
button primaryC)
class-btn primaryD)
bg-primary button
Answer: A) btn btn-primary
Q10. What is the standard breakpoint abbreviation for extra-large screens (min-width: 1200px) in Bootstrap 5?
A)
smB)
mdC)
lgD)
xl
Answer: D) xl
SOME MORE:
Here is a comprehensive list of 100 multiple-choice questions (MCQs) on Bootstrap, organized by topic. Each question includes the correct answer and a brief explanation to help you master the framework.
📋 Section 1: Introduction, Setup & Basics (Questions 1–15)
1. What is Bootstrap?
A) A server-side JavaScript framework
B) A popular open-source front-end framework for responsive web development
C) A database management tool
D) An alternative to HTML
Answer: B
Explanation: Bootstrap is a powerful HTML, CSS, and JS framework used for developing responsive, mobile-first websites.
2. Who originally developed Bootstrap?
A) Google
B) Facebook
C) Twitter
D) Microsoft
Answer: C
Explanation: Bootstrap was created by Mark Otto and Jacob Thornton at Twitter, originally named Twitter Blueprint.
3. What design philosophy does Bootstrap heavily rely on?
A) Desktop-first
B) Mobile-first
C) Backend-first
D) Print-first
Answer: B
Explanation: Bootstrap is designed to be mobile-first, meaning styles are optimized for mobile devices first, then scaled up using CSS media queries.
4. Which of the following is required for Bootstrap to function properly?
A) An HTML5 doctype declaration
B) A Python backend
C) A C++ compiler
D) MySQL
Answer: A
Explanation: Bootstrap requires the use of the HTML5 doctype (
<!DOCTYPE html>) to ensure proper rendering and component sizing.
5. What is the purpose of the <meta name="viewport" ...> tag when using Bootstrap?
A) To inject Google Analytics
B) To ensure proper rendering and touch zooming on mobile devices
C) To link external CSS files
D) To encrypt the page data
Answer: B
Explanation: The viewport meta tag controls layout width on mobile browsers and ensures the mobile-first nature of Bootstrap functions correctly.
6. Which class provides a full-width container that spans the entire width of the viewport?
A)
.containerB)
.container-fixedC)
.container-fluidD)
.container-full
Answer: C
Explanation:
.container-fluidcreates a 100% wide container at all breakpoints, whereas.containerhas fixed max-widths depending on the screen size.
7. How many default grid tiers (breakpoints) are available in Bootstrap 5?
A) 3
B) 4
C) 5
D) 6
Answer: D
Explanation: Bootstrap 5 features six grid tiers: Extra small (xs), Small (sm), Medium (md), Large (lg), Extra large (xl), and Extra extra large (xxl).
8. Which version of Bootstrap officially dropped its dependency on jQuery?
A) Bootstrap 3
B) Bootstrap 4
C) Bootstrap 5
D) Bootstrap 6
Answer: C
Explanation: Bootstrap 5 completely removed the jQuery dependency, opting for pure vanilla JavaScript instead.
9. Which tool can be used to compile Bootstrap's source code if you want to customize it?
A) Sass
B) Java
C) PHP
D) SQL
Answer: A
Explanation: Bootstrap is written in Sass (Syntactically Awesome Style Sheets), allowing developers to utilize variables, mixins, and functions for custom builds.
10. What is the default font stack used by Bootstrap?
A) Times New Roman
B) A native system font stack (e.g., Segoe UI, Roboto, Helvetica Neue)
C) Courier New
D) Comic Sans
Answer: B
Explanation: Bootstrap utilizes a native system font stack for optimal text rendering on every device and OS without downloading web fonts.
11. Which HTML tag is generally used to wrap Bootstrap navigation links inside a header?
A)
<nav>B)
<section>C)
<div>D)
<aside>
Answer: A
Explanation: Semantic HTML recommends the
<nav>tag for major navigation block containers.
12. Where should the Bootstrap JavaScript bundle (bootstrap.bundle.min.js) be ideally placed?
A) Inside the
<head>sectionB) At the very end of the
<body>sectionC) In a separate
.cssfileD) Inside an
<img>tag
Answer: B
Explanation: Placing JavaScript execution scripts right before the closing
</body>tag prevents them from blocking HTML parsing.
13. What is included in the Bootstrap JavaScript "Bundle" file that isn't in the standard JS file?
A) jQuery
B) Popper.js
C) React
D) FontAwesome
Answer: B
Explanation: The Bootstrap Bundle includes Popper.js, which is strictly required for tooltips, popovers, and dropdown positioning mechanics.
14. In Bootstrap, components like borders, display states, and spacing are handled by:
A) Heavy JavaScript scripts
B) Utility classes
C) Grid column spans
D) Media queries alone
Answer: B
Explanation: Utility classes provide single-purpose styling shortcuts (e.g.,
.d-none,.border,.p-3) to minimize custom CSS writing.
15. What does the class .container do?
A) Centers content horizontally with a responsive fixed width
B) Automatically hides content on mobile devices
C) Changes the color of the text to blue
D) Forces the page to refresh
Answer: A
Explanation:
.containersets amax-widthat each responsive breakpoint and centers the layout block horizontally.
📐 Section 2: The Grid System (Questions 16–35)
16. The Bootstrap grid system is based on how many columns?
A) 6
B) 10
C) 12
D) 16
Answer: C
Explanation: The default grid layout features 12 columns, allowing flexible distribution patterns (e.g., halves, thirds, quarters).
17. Which underlying CSS technology powers the Bootstrap grid system?
A) CSS Grid exclusively
B) Floats and Clears
C) Flexbox
D) Inline-blocks
Answer: C
Explanation: Bootstrap's primary grid system is built entirely on CSS Flexbox configurations.
18. What is the correct structural hierarchy for Bootstrap grid layouts?
A)
Row -> Container -> ColumnB)
Container -> Row -> ColumnC)
Column -> Row -> ContainerD)
Row -> Column -> Container
Answer: B
Explanation: Columns (
.col-*) must be direct children of rows (.row), which in turn must be housed within a container (.containeror.container-fluid).
19. Which class is used to create a grid row wrapper?
A)
.grid-rowB)
.rowC)
.lineD)
.layout-row
Answer: B
Explanation:
.rowacts as a flexbox container wrapper that properly lines up columns and manages negative margins.
20. If a row contains columns that total more than 12 in value, what happens?
A) The layout breaks and overlaps
B) The extra columns wrap onto a new line
C) The browser throws an error
D) Columns scale down automatically to fit the row width
Answer: B
Explanation: Because rows are configured as flex containers with wrapping enabled, column spans exceeding 12 wrap to the next row block.
21. Which class should you use for a column that should span 4 grid columns on medium devices and larger?
A)
.col-m-4B)
.col-md-4C)
.col-4-mdD)
.medium-col-4
Answer: B
Explanation: The syntax structure follows
.col-[breakpoint]-[size]. Hence,.col-md-4handles medium screen rules.
22. What happens when you apply just .col to multiple column elements inside a .row?
A) They stack vertically
B) They split the available row space equally
C) They default to 100% viewport width
D) They throw validation warnings
Answer: B
Explanation: Applying
.colutilizes flex-grow properties to divide row space equally among all sibling columns.
23. Which class prefix targets extra-large screens (1200px and up)?
A)
.col-lg-B)
.col-xl-C)
.col-xxl-D)
.col-max-
Answer: B
Explanation: The
.col-xl-prefix specifically applies styles at breakpoints equal to or greater than 1200px.
24. How do you remove the gutters (padding/margins) from a row and its columns?
A)
.no-guttersB)
.g-0C)
.gutter-noneD)
.row-flat
Answer: B
Explanation: In Bootstrap 5, gutter utility variables are controlled using the
g-*utility prefix..g-0sets gutters to 0.
25. Which class sets a gutter size explicitly along the horizontal x-axis?
A)
.gx-*B)
.gy-*C)
.g-width-*D)
.gh-*
Answer: A
Explanation:
.gx-*modifies horizontal column paddings, whereas.gy-*modifies vertical row margins.
26. How can you shift or push a column to the right using margins?
A)
.push-*B)
.offset-*C)
.pull-*D)
.move-*
Answer: B
Explanation: Offset utility classes (e.g.,
.offset-md-4) increase the left margin of a column to shift it horizontally.
27. Which class forces columns to stack vertically on extra-small screens but become a 6-column grid layout on small screens (576px and up)?
A)
.col-6B)
.col-sm-6C)
.col-xs-6D)
.col-md-6
Answer: B
Explanation: Because Bootstrap is mobile-first, it stacks columns vertically by default unless a breakpoint rule like
.col-sm-6overrides it.
28. Can grid columns be nested within other grid columns?
A) No, nesting breaks layouts
B) Yes, by adding a new
.rowinside an existing.col-*C) Yes, by nesting containers directly
D) Only up to 2 levels deep
Answer: B
Explanation: To nest columns safely, insert a new
.rowwrapper inside the current column container, which yields a fresh set of 12 internal slots.
29. Which class dynamically changes the visual rendering order of a column?
A)
.sort-*B)
.order-*C)
.z-index-*D)
.arrange-*
Answer: B
Explanation: The
.order-*utilities leverage flexbox ordering rules to rearrange grid layout placements independently from the DOM structure.
30. What is the value of the breakpoint for large devices (lg) in Bootstrap 5?
A) 768px
B) 992px
C) 1200px
D) 1400px
Answer: B
Explanation: Large devices (
lg) apply rules to screen configurations starting at 992px and extending up to the next breakpoint.
31. What is the screen size threshold for the Extra Extra Large (xxl) breakpoint introduced in Bootstrap 5?
A) 1200px
B) 1400px
C) 1600px
D) 2000px
Answer: B
Explanation: The
xxltier triggers styles on wide desktop environments measuring 1400px or higher.
32. Which class creates a variable-width column that sizes itself based on its natural content width?
A)
.col-contentB)
.col-autoC)
.col-fitD)
.col-size-zero
Answer: B
Explanation:
.col-autostructures a column box that shrinks or expands to perfectly match its internal content dimensions.
33. To align grid columns vertically along the bottom of a row container, which class should be added to the .row?
A)
.align-items-startB)
.align-items-endC)
.align-content-bottomD)
.justify-content-end
Answer: B
Explanation:
.align-items-endapplies the flexbox alignment rule to anchor child elements to the bottom edge of the row container.
34. To space columns out evenly along the horizontal axis with equal gaps between them, which class is added to the row?
A)
.justify-content-centerB)
.justify-content-betweenC)
.justify-content-aroundD)
.align-items-center
Answer: C
Explanation:
.justify-content-arounddistributes columns along the main row horizontal axis with equal structural clearance rooms around each element block.
35. What class sets a column width to exactly 50% across all devices?
A)
.col-halfB)
.col-md-6C)
.col-6D)
.col-xs-6
Answer: C
Explanation: Because 6 is half of the 12-column grid,
.col-6applies a 50% width rule starting at the smallest breakpoint.
🔤 Section 3: Typography, Tables, & Images (Questions 36–50)
36. Which class gives standard body paragraphs standout emphasis (larger font size and lighter weight)?
A)
.importantB)
.leadC)
.highlightD)
.text-large
Answer: B
Explanation: The
.leadtypography utility makes text stand out by slightly increasing its size and weight.
37. How do you format text to look like a heading element when semantic header tags cannot be used (e.g., an inline span)?
A) Add classes
.h1through.h6B) Add classes
.head-1through.head-6C) Add class
.headingD) This cannot be done without custom CSS style rules
Answer: A
Explanation: Bootstrap provides classes like
.h1through.h6to style generic inline text elements like native structural heading tags.
38. Which utility class converts text to uppercase characters?
A)
.upperB)
.text-upperC)
.text-uppercaseD)
.capitalize
Answer: C
Explanation:
.text-uppercasetransforms text characters to uppercase using CSS text-transform utilities.
39. How do you align text to the right side of its container in Bootstrap?
A)
.text-rightB)
.text-endC)
.align-rightD)
.float-right
Answer: B
Explanation: Bootstrap 5 updated directional alignment terms to match modern standard CSS logical properties:
.text-start(left) and.text-end(right).
40. Which class creates a responsive, bordered table with alternating row background colors?
A)
.table .table-stripedB)
.table .table-alternateC)
.table-zebraD)
.table-rows
Answer: A
Explanation:
.table-stripedapplies light gray zebra-striping to alternating table rows inside an active base.tableclass declaration.
41. How do you make a table responsive so it scrolls horizontally on smaller viewports?
A) Add
.table-responsivedirectly to the<table>elementB) Wrap the
<table>element inside a<div>containing the.table-responsiveclassC) Add
.table-scrollto the container bodyD) Tables are automatically responsive by default in Bootstrap
Answer: B
Explanation: Tables require a parent element wrapper with
.table-responsiveto establish horizontal scroll behaviors on smaller screens.
42. Which class makes an image responsive, scaling it to fit its container width smoothly?
A)
.img-responsiveB)
.img-fluidC)
.responsive-imageD)
.img-fit
Answer: B
Explanation: In Bootstrap 5,
.img-fluidappliesmax-width: 100%;andheight: auto;to make an image scale responsively.
43. How do you give an image a subtle rounded frame border style?
A)
.img-frameB)
.img-thumbnailC)
.image-borderD)
.img-rounded
Answer: B
Explanation:
.img-thumbnailadds a light 1px border outline with padding and slightly rounded corners to an image.
44. Which class centers an inline block image element horizontally?
A)
.img-centerB)
.mx-auto .d-blockC)
.align-centerD)
.text-centerapplied directly to the image
Answer: B
Explanation: Images are inline elements by default. To center them, change their display to block with
.d-blockand apply auto margins with.mx-auto.
45. Which class formats code blocks or inline code elements safely?
A) Just use standard HTML
<code>tags which Bootstrap automatically stylesB)
.code-boxC)
.bootstrap-codeD)
.text-monospace
Answer: A
Explanation: Bootstrap applies global reboot style rules that automatically enhance native code tags like
<code>and<pre>without additional helper classes.
46. Which text alignment class targets only medium devices and larger?
A)
.text-md-centerB)
.center-md-textC)
.text-center-mdD)
.medium-text-center
Answer: A
Explanation: Responsive text alignment utilities follow the standard format
.text-[breakpoint]-[alignment].
47. Which class strips out default bullet points and left paddings from list elements (<ul> or <ol>)?
A)
.list-cleanB)
.list-unstyledC)
.no-bulletsD)
.list-inline
Answer: B
Explanation:
.list-unstyledremoves list styling markers and resets default list margins/paddings.
48. To line up list items horizontally on a single row, which class pair is applied?
A)
.list-inlineon the list parent and.list-inline-itemon child itemsB)
.list-horizontalon the itemsC)
.row-liston the containerD)
.list-flexacross elements
Answer: A
Explanation:
.list-inlinecombined with.list-inline-itemdisplays block items inline to build clean text lists.
49. Which class highlights a text snippet by rendering it with a yellow background?
A)
.text-highlightB)
.bg-warningor wrapping in native<mark>tagsC)
.alert-textD)
.paint-yellow
Answer: B
Explanation: Bootstrap automatically customizes the default styles for the HTML5
<mark>tag, which applies a light yellow background color.
50. Which color utility class indicates danger or an error text message?
A)
.text-dangerB)
.text-errorC)
.text-warningD)
.text-critical
Answer: A
Explanation:
.text-dangercolors the text red to indicate errors or dangerous actions, following standard Bootstrap color nomenclature.
🧱 Section 4: Components - Buttons, Forms & Navbars (Questions 51–75)
51. What is the base class required for any button styling in Bootstrap?
A)
.buttonB)
.btnC)
.bootstrap-btnD)
.btn-base
Answer: B
Explanation: Every button requires the core
.btnclass to establish padding, borders, and transitions before applying color variations.
52. Which class generates a primary blue action button?
A)
.btn-blueB)
.btn-primaryC)
.btn-actionD)
.btn-main
Answer: B
Explanation:
.btn-primaryapplies the theme's primary accent color (default blue) to structural button elements.
53. How do you create an outline button style that has a transparent background and fills in only on hover?
A)
.btn-outline-primaryB)
.btn-transparentC)
.btn-hollowD)
.btn-border-primary
Answer: A
Explanation: The
.btn-outline-*class format strips out solid background fills in favor of thin color borders until interaction occurs.
54. Which class combination creates a large, full-width block-level button in Bootstrap 5?
A)
.btn-blockB) Wrapping the button in a layout div with
.d-gridand using standard button classesC)
.btn-large-blockD)
.btn-fw
Answer: B
Explanation: Bootstrap 5 dropped
.btn-block. Full-width buttons are now created by wrapping them in layout elements using utilities like.d-grid.
55. Which form class is applied to input elements like text inputs and textareas for full width and styling?
A)
.form-inputB)
.form-controlC)
.input-fieldD)
.form-style
Answer: B
Explanation: The
.form-controlclass styles form text elements, handling focus states, border curves, and sizing.
56. What class is applied to checkbox and radio inputs in Bootstrap 5?
A)
.form-check-inputB)
.form-controlC)
.input-checkD)
.form-radio
Answer: A
Explanation: Checkboxes and radio buttons require
.form-check-inputto align correctly with Bootstrap's custom form layouts.
57. Which component provides contextual feedback messages for typical user actions (e.g., success warnings)?
A) Badge
B) Alert
C) Toast
D) Card
Answer: B
Explanation: Alerts (
.alert) provide flexible wrapper blocks for displaying validation notices or callout messages.
58. How do you make an alert dismissible by adding a close button?
A) Add the
.alert-dismissibleclass and a close button withdata-bs-dismiss="alert"B) Add
.alert-closeto the textC) Use JavaScript exclusively to remove the element from the DOM
D) Add
dismiss="true"as an HTML attribute
Answer: A
Explanation: The
.alert-dismissibleclass adds padding near the edge of the alert, while thedata-bs-dismiss="alert"attribute hooks into the JavaScript to handle the closing functionality.
59. Which class is the structural container container used to construct cards?
A)
.cardB)
.panelC)
.boxD)
.card-wrapper
Answer: A
Explanation: The
.cardcomponent replaced older panels, wells, and thumbnails to provide an all-in-one content container.
60. Inside a card component, where should the primary descriptive textual contents be housed?
A)
.card-headB)
.card-bodyC)
.card-contentD)
.card-inner
Answer: B
Explanation:
.card-bodyprovides a padded canvas section inside a card to house text, titles, and links.
61. What component represents a flexible navigation header bar?
A)
.navigationB)
.navbarC)
.nav-menuD)
.menu-bar
Answer: B
Explanation: The
.navbarcomponent functions as a responsive navigation wrapper, handling brand links, collapse triggers, and layout alignments.
62. Which class determines the responsive breakpoint at which a navbar uncollapses into a full horizontal menu?
A)
.navbar-expand-lgB)
.navbar-toggle-lgC)
.navbar-responsiveD)
.navbar-desktop
Answer: A
Explanation:
.navbar-expand-[breakpoint]dictates exactly when a navigation structure shifts from a mobile hamburger layout to a wide horizontal layout.
63. How do you create a navigation bar with a dark theme background color?
A)
.navbar-dark .bg-darkB)
.navbar-blackC)
.navbar .bg-darkD)
.navbar-theme-dark
Answer: A
Explanation: Combining
.navbar-dark(which optimizes link colors for dark backgrounds) with a background utility like.bg-darkcreates a clean dark navbar layout.
64. Which class is used to style the logo or brand text inside a navbar?
A)
.navbar-logoB)
.navbar-brandC)
.navbar-titleD)
.brand-link
Answer: B
Explanation:
.navbar-brandapplies appropriate padding, font size, and layout properties for brand names or logos inside navbars.
65. What component is used to show a hierarchical trail of links indicating the user's current location within a site?
A) Pagination
B) Breadcrumb
C) Nav-tree
D) Progress indicator
Answer: B
Explanation: The
.breadcrumbcomponent styles lists to show location trails, automatically inserting dividers via CSS.
66. Which class group implements paginated page step indexes at the bottom of listings?
A)
.paginationon the parent and.page-itemwith.page-linkon child elementsB)
.pagerand.page-numberC)
.list-pagesD)
.page-control
Answer: A
Explanation: Structuring an unordered list with
.pagination,.page-item, and.page-linkbuilds a standard, clickable pagination component.
67. Which component displays small count indicators or labels inside buttons or headers?
A) Alert
B) Badge
C) Toast
D) Tooltip
Answer: B
Explanation: The
.badgecomponent styles inline text elements to create small labels or count indicators.
68. What component is used to display loading states or computational processing loops?
A) Progress
B) Spinner
C) Toast
D) Placeholder
Answer: B
Explanation:
.spinner-borderor.spinner-growbuilds CSS-animated loading states without requiring external assets.
69. Which button size modifier makes buttons compact and small?
A)
.btn-sB)
.btn-smC)
.btn-miniD)
.btn-small
Answer: B
Explanation: Button size modifiers include
.btn-sm(small) and.btn-lg(large).
70. How do you align an individual item inside a navbar to the right side?
A) Apply the
.ms-auto(margin-start: auto) utility to it or its parent groupB) Apply
.float-rightC) Apply
.navbar-rightD) Apply
.align-right
Answer: A
Explanation: Because navbars use flexbox layouts, applying
.ms-autopushes the element and all subsequent items to the right side of the container.
71. Which component shows a sliding photo carousel cycle?
A)
.sliderB)
.carouselC)
.galleryD)
.slideshow
Answer: B
Explanation: The
.carouselcomponent provides a slideable slideshow framework for cycling through images or custom content blocks.
72. Which component features multi-layered collapse accordions that expand individually?
A)
.accordionB)
.collapse-groupC)
.list-groupD)
.tab-content
Answer: A
Explanation: The
.accordioncomponent relies on the collapse plugin to build vertically stacking, expandable content panels.
73. Which Bootstrap 5 utility class provides subtle border-radius rounding updates to elements?
A)
.roundedB)
.border-roundC)
.circle-boxD)
.radius-4
Answer: A
Explanation:
.roundedapplies standard border-radius curves. Variations include.rounded-circle,.rounded-pill, or directional updates like.rounded-top.
74. Which component handles small temporary toast notification bubbles that slide up out of view edges?
A) Alert
B) Popover
C) Toast
D) Banner
Answer: C
Explanation:
.toastprovides lightweight, push-style notifications designed to mimic mobile operating system notification panels.
75. What class creates a styled vertical or horizontal list of item groups?
A)
.list-groupB)
.item-listC)
.group-listD)
.nav-list
Answer: A
Explanation:
.list-groupis a flexible component for displaying a series of content items, which can be extended with custom HTML or interactive links.
⚡ Section 5: Advanced JavaScript Components & Interactivity (Questions 76–90)
76. Which data attribute binds a click trigger to open a Bootstrap modal dialog window?
A)
data-bs-toggle="modal"B)
data-bs-target="modal"C)
data-toggle="popup"D)
href="#modal"
Answer: A
Explanation: In Bootstrap 5,
data-bs-toggle="modal"identifies the button as a modal controller, whiledata-bs-targetpoints to the specific modal's ID.
77. What attribute specifies the target element ID that a transition component affects?
A)
data-bs-toggleB)
data-bs-targetC)
data-bs-idD)
data-bs-href
Answer: B
Explanation:
data-bs-targetuses a CSS selector string (like#myModalID) to target the target container to animate or toggle.
78. Which component displays a dim background layer behind an open modal?
A) Backdrop
B) Overlay
C) Curtain
D) Shadow
Answer: A
Explanation: The modal backdrop automatically darkens the page content when a modal is active to focus user attention on the dialog.
79. How do you center a modal vertically on the screen?
A) Add
.modal-centerto the core wrapperB) Add
.modal-dialog-centeredto the.modal-dialogelementC) Apply margin auto tools
D) Modals are centered vertically by default
Answer: B
Explanation: Adding
.modal-dialog-centeredto the inner.modal-dialogcontainer aligns the modal vertically on the screen.
80. Are tooltips enabled by default when you load Bootstrap's JavaScript bundle?
A) Yes, they initialize automatically
B) No, they must be manually initialized via JavaScript due to performance reasons
C) Only when using specific theme setups
D) Only on desktop computers
Answer: B
Explanation: Tooltips and Popovers are opt-in plugins, meaning you must write a short snippet of custom JavaScript to initialize them on the page.
81. Which component provides a small pop-up box containing text when an element is clicked, but contains more content than a tooltip?
A) Alert
B) Toast
C) Popover
D) Dropdown
Answer: C
Explanation: Popovers resemble tooltips but include an optional header section and can store larger bodies of HTML or descriptive text.
82. Which JS plugin tracks page scroll positions to automatically highlight the corresponding links in a navigation menu?
A) Scrollspy
B) Scrolltracker
C) Navspy
D) AutoScroll
Answer: A
Explanation: Scrollspy automatically updates navigation active states based on the user's current scroll position relative to content sections.
83. Which class hides content accessibly from screen readers but displays it visually on screens?
A)
.invisibleB) There is no class for this, only the reverse via
.visually-hiddenC)
.sr-onlyD)
.d-none
Answer: B
Explanation:
.visually-hiddenhides an element visually while keeping it readable by screen readers. There is no utility class that does the reverse.
84. Which attribute allows a modal to be closed when the "Escape" key is pressed?
A)
data-bs-keyboard="true"B)
data-bs-escape="close"C)
keyboard="active"D) It is handled automatically unless
data-bs-keyboard="false"is applied
Answer: D
Explanation: Bootstrap modals respond to the Escape key by default unless explicitly configured otherwise via JavaScript settings or data attributes.
85. How do you programmatically toggle a modal named myModal using JavaScript in Bootstrap 5?
A)
$('#myModal').modal('toggle');B)
var modal = new bootstrap.Modal(document.getElementById('myModal')); modal.toggle();C)
myModal.bootstrap('show');D)
bootstrap.toggle('#myModal');
Answer: B
Explanation: Bootstrap 5 relies on vanilla JavaScript API declarations rather than jQuery method chains.
86. Which class makes a component fade in smoothly when triggered?
A)
.fadeB)
.animate-fadeC)
.transition-inD)
.opaque
Answer: A
Explanation: Adding the
.fadeutility class to components like modals or alerts applies a smooth CSS transition effect when they are toggled.
87. What component provides hidden slide-out sidebar panels, often used for mobile menus or shopping carts?
A) Modal
B) Offcanvas
C) Drawer
D) Accordion
Answer: B
Explanation: The
.offcanvascomponent builds sidebar containers that slide in from the top, bottom, left, or right edges of the viewport.
88. Which class creates a dropdown menu container?
A)
.dropdown-menuB)
.dropdown-listC)
.menu-contentD)
.popup-menu
Answer: A
Explanation: The toggleable list of links inside a dropdown component must be wrapped in an element containing the
.dropdown-menuclass.
89. Which attribute overrides default placement options for tooltips (e.g., forcing a tooltip to appear to the right)?
A)
data-bs-placement="right"B)
data-bs-direction="right"C)
data-bs-position="end"D)
tooltip-align="right"
Answer: A
Explanation:
data-bs-placementacceptstop,bottom,left, orrightparameters to control tooltip orientation.
90. Which class creates a subtle text shimmer animation used to indicate content loading templates?
A)
.spinner-growB)
.placeholderor.placeholder-glowC)
.loading-shimmerD)
.fade-loop
Answer: B
Explanation: Bootstrap 5's placeholder components use layout structures and animations (like
.placeholder-glow) to build mock loading interfaces.
🛠️ Section 6: Spacing & Color Utilities (Questions 91–100)
91. In Bootstrap's spacing notation (m-3, p-2), what does the first letter stand for?
A) Measurement
B) Mode
C) Margin or Padding
D) Maximum limit
Answer: C
Explanation: The first letter specifies the spacing type:
mfor margin utilities andpfor padding utilities.
92. What does the class .py-4 apply?
A) Padding on both the top and bottom (y-axis)
B) Padding on both the left and right (x-axis)
C) Yearly layout margins
D) A 4px padding around all sides
Answer: A
Explanation: The
ydirectional indicator targets the vertical axis, applying spacing modifications to both the top and bottom edges.
93. Which class applies a margin to the right side of an element on medium screens and larger in Bootstrap 5?
A)
.mr-md-*B)
.me-md-*C)
.margin-right-md-*D)
.ms-md-*
Answer: B
Explanation: In Bootstrap 5, directional utilities use
s(start/left) ande(end/right). Therefore,.me-md-*applies a margin-end on medium devices and up.
94. What is the default background utility class for a green success color?
A)
.bg-greenB)
.bg-successC)
.bg-positiveD)
.bg-safe
Answer: B
Explanation:
.bg-successmaps to the theme's default green success color keyword block.
95. What does the class .mx-auto do?
A) Automatically sets width dimensions
B) Centers a block element horizontally by setting left and right margins to auto
C) Clears all floating elements along the axis
D) Scales text sizes dynamically
Answer: B
Explanation:
.mx-autosets horizontal margins (margin-leftandmargin-right) toauto, centering block-level elements within their parents.
96. Which opacity class makes an element semi-transparent?
A)
.opacity-50B)
.opacity-halfC)
.alpha-5D)
.translucent
Answer: A
Explanation: Bootstrap includes built-in opacity utilities like
.opacity-25,.opacity-50,.opacity-75, and.opacity-100.
97. Which display utility hides an element on mobile devices but displays it as a block on medium screens and larger?
A)
.d-none .d-md-blockB)
.d-md-blockC)
.hidden .visible-mdD)
.d-mobile-none
Answer: A
Explanation:
.d-nonehides the element by default (mobile-first), and.d-md-blockoverrides that rule to display it starting at the medium breakpoint.
98. Which color context represents an accent color intended for informational callouts (default cyan/light blue)?
A) Primary
B) Secondary
C) Info
D) Light
Answer: C
Explanation:
.text-info,.bg-info, and.btn-infoutilize the information theme color (typically cyan).
99. Which spacing utility class completely strips all margins from an element?
A)
.m-noneB)
.m-0C)
.margin-clearD)
.p-0
Answer: B
Explanation: Setting the spacing numeric index to
0(e.g.,.m-0,.p-0) removes all margins or paddings.
100. How can you add a subtle shadow effect to an element container using Bootstrap utility classes?
A)
.shadowB)
.box-shadowC)
.element-shadowD)
.shadow-true
Answer: A
Explanation: The
.shadowutility class applies a default box-shadow to elements. Variations include.shadow-sm(small shadow) and.shadow-lg(large shadow).
No comments:
Post a Comment