Bird
Raised Fist0
Bootsrapmarkup~10 mins

Why Bootstrap exists - Test Your Understanding

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to include Bootstrap CSS in your HTML file.

Bootsrap
<link rel="stylesheet" href="[1]">
Drag options to blanks, or click blank then click option'
Astyles.css
Bhttps://example.com/style.css
Cbootstrap.js
Dhttps://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local CSS file that doesn't have Bootstrap styles.
Linking to a JavaScript file instead of CSS.
2fill in blank
medium

Complete the code to add a Bootstrap button with primary style.

Bootsrap
<button class="btn [1]">Click me</button>
Drag options to blanks, or click blank then click option'
Abtn-primary
Bbtn-link
Cbtn-danger
Dbtn-secondary
Attempts:
3 left
💡 Hint
Common Mistakes
Using a button class that does not exist or is for a different style.
Forgetting to include the base btn class.
3fill in blank
hard

Fix the error in the Bootstrap grid code by completing the missing class.

Bootsrap
<div class="container">
  <div class="row">
    <div class="[1]">Content</div>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Arow-12
Bgrid-12
Ccol-12
Dcontainer-12
Attempts:
3 left
💡 Hint
Common Mistakes
Using row-12 which is not a valid column class.
Confusing container and column classes.
4fill in blank
hard

Fill in the blank to create a responsive Bootstrap navbar that collapses on small screens.

Bootsrap
<nav class="navbar navbar-expand-[1] bg-light">
  <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <!-- Navbar content -->
  </div>
</nav>
Drag options to blanks, or click blank then click option'
Alg
Bsm
Cmd
Dxl
Attempts:
3 left
💡 Hint
Common Mistakes
Using a breakpoint like sm which expands too early on small screens.
Using invalid breakpoint names.
5fill in blank
hard

Fill all three blanks to create a Bootstrap card with a header, body text, and a button.

Bootsrap
<div class="card" style="width: 18rem;">
  <div class="card-[1]">Card Header</div>
  <div class="card-[2]">
    <p class="card-text">Some quick example text.</p>
    <a href="#" class="btn btn-[3]">Go somewhere</a>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Aheader
Bbody
Cprimary
Dfooter
Attempts:
3 left
💡 Hint
Common Mistakes
Using card-footer instead of card-header for the header.
Forgetting the btn class on the button.

Practice

(1/5)
1. Why was Bootstrap created?
Why Bootstrap exists
easy
A. To help build websites faster with ready-made styles
B. To replace HTML with a new language
C. To create desktop software applications
D. To make websites only for mobile phones

Solution

  1. Step 1: Understand Bootstrap's purpose

    Bootstrap provides pre-made styles and components to speed up website building.
  2. Step 2: Compare options with Bootstrap's goal

    Only To help build websites faster with ready-made styles matches the goal of faster website creation with styles.
  3. Final Answer:

    To help build websites faster with ready-made styles -> Option A
  4. Quick Check:

    Bootstrap speeds up styling = A [OK]
Hint: Bootstrap = faster styling and layout for websites [OK]
Common Mistakes:
  • Thinking Bootstrap replaces HTML
  • Believing Bootstrap is for desktop apps only
  • Assuming Bootstrap is only for mobile
2. Which is the correct way to include Bootstrap CSS in your HTML file?
easy
A.
B.
C.
D.

Solution

  1. Step 1: Identify how CSS files are linked in HTML

    CSS files are linked using the <link> tag with rel="stylesheet".
  2. Step 2: Check options for correct syntax

    Only uses the correct <link> tag for CSS.
  3. Final Answer:

    <link rel="stylesheet" href="bootstrap.css"> -> Option C
  4. Quick Check:

    CSS linked with <link> tag = C [OK]
Hint: CSS files use tag [OK]
Common Mistakes:
  • Using <script> tag for CSS
  • Using <style> tag with src attribute
  • Using <img> tag for CSS
3. What will this HTML code display in a browser?
<button class="btn btn-primary">Click Me</button>
medium
A. A plain button with default browser style
B. A blue styled button with padding and rounded corners
C. An error message because class names are wrong
D. A button with no text

Solution

  1. Step 1: Understand Bootstrap button classes

    The class "btn" styles the element as a button, and "btn-primary" adds a blue color with padding and rounded corners.
  2. Step 2: Predict the visual output

    The button will appear blue with nice padding and rounded edges, not plain or empty.
  3. Final Answer:

    A blue styled button with padding and rounded corners -> Option B
  4. Quick Check:

    btn-primary = blue styled button [OK]
Hint: "btn-primary" means blue styled button in Bootstrap [OK]
Common Mistakes:
  • Thinking it shows default browser button
  • Assuming class names cause errors
  • Expecting button with no text
4. This HTML uses Bootstrap classes but the styles are not applied. What is the likely problem?
<button class="btn btn-success">Save</button>
medium
A. Bootstrap CSS file is not linked in the HTML
B. The button tag is incorrect and should be <div>
C. Class names "btn" and "btn-success" are invalid
D. The button text "Save" is missing

Solution

  1. Step 1: Check if Bootstrap CSS is linked

    If Bootstrap CSS is missing, classes like "btn" and "btn-success" won't style the button.
  2. Step 2: Verify other options

    Button tag is correct, class names are valid, and text is present, so problem is missing CSS link.
  3. Final Answer:

    Bootstrap CSS file is not linked in the HTML -> Option A
  4. Quick Check:

    Missing CSS link = no styles applied [OK]
Hint: No styles? Check if Bootstrap CSS is linked [OK]
Common Mistakes:
  • Changing button tag unnecessarily
  • Thinking class names are wrong
  • Assuming button text is missing
5. You want your website to look good on phones, tablets, and desktops automatically. How does Bootstrap help with this?
hard
A. Bootstrap converts your HTML into a mobile app automatically
B. Bootstrap requires you to write separate code for each device
C. Bootstrap disables styles on small screens to save data
D. Bootstrap provides responsive grid and classes that adjust layout based on screen size

Solution

  1. Step 1: Understand Bootstrap's responsive features

    Bootstrap uses a grid system and responsive classes that change layout and styles depending on screen size.
  2. Step 2: Evaluate options for correct explanation

    Only Bootstrap provides responsive grid and classes that adjust layout based on screen size correctly describes Bootstrap's automatic adjustment for different devices.
  3. Final Answer:

    Bootstrap provides responsive grid and classes that adjust layout based on screen size -> Option D
  4. Quick Check:

    Responsive grid = automatic layout adjustment [OK]
Hint: Bootstrap grid adapts layout to screen size automatically [OK]
Common Mistakes:
  • Thinking Bootstrap converts HTML to apps
  • Believing Bootstrap disables styles on small screens
  • Assuming separate code needed per device
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard