Bird
Raised Fist0
Bootsrapmarkup~10 mins

Why cards organize content in Bootsrap - Test Your Understanding

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

Complete the code to create a Bootstrap card container.

Bootsrap
<div class="[1]">
  <div class="card">
    <div class="card-body">
      This is a card.
    </div>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Arow
Bcard-group
Ccontainer
Dcard-deck
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'row' instead of 'container' causes layout issues.
Using 'card-group' or 'card-deck' without a container can break responsiveness.
2fill in blank
medium

Complete the code to add a card title inside the card body.

Bootsrap
<div class="card">
  <div class="card-body">
    <h5 class="[1]">Card Title</h5>
    <p class="card-text">Some quick example text.</p>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Acard-title
Bcard-footer
Ccard-subtitle
Dcard-header
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'card-header' inside card-body is incorrect.
Using 'card-footer' or 'card-subtitle' changes the style and meaning.
3fill in blank
hard

Fix the error in the card image code by completing the class name.

Bootsrap
<div class="card" style="width: 18rem;">
  <img src="image.jpg" class="[1]" alt="Card image">
  <div class="card-body">
    <p class="card-text">Image above the text.</p>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Acard-img-top
Bcard-image
Cimg-top
Dcard-img
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'card-image' or 'img-top' are not valid Bootstrap classes.
Using 'card-img' alone does not position the image correctly.
4fill in blank
hard

Fill both blanks to create a card with a header and footer.

Bootsrap
<div class="card">
  <div class="[1]">Featured</div>
  <div class="card-body">
    <p class="card-text">Content inside the card body.</p>
  </div>
  <div class="[2]">Footer text</div>
</div>
Drag options to blanks, or click blank then click option'
Acard-header
Bcard-body
Ccard-footer
Dcard-title
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'card-body' for header or footer is incorrect.
Mixing up 'card-title' with header or footer classes.
5fill in blank
hard

Fill all three blanks to create a card with an image, title, and button.

Bootsrap
<div class="card" style="width: 18rem;">
  <img src="pic.jpg" class="[1]" alt="Card image">
  <div class="card-body">
    <h5 class="[2]">Card Title</h5>
    <a href="#" class="btn [3]">Go somewhere</a>
  </div>
</div>
Drag options to blanks, or click blank then click option'
Acard-img-top
Bcard-title
Cbtn-primary
Dbtn-secondary
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'btn-secondary' instead of 'btn-primary' changes button color.
Using 'card-img' instead of 'card-img-top' changes image placement.

Practice

(1/5)
1. Why do Bootstrap cards help organize content on a webpage?
easy
A. They group related content in a clear, boxed layout.
B. They automatically change the website's background color.
C. They remove all images from the page.
D. They make the text invisible to users.

Solution

  1. Step 1: Understand the purpose of cards

    Cards are designed to group related content visually in a box format.
  2. Step 2: Compare options with card features

    Only grouping content clearly matches what cards do; other options describe unrelated effects.
  3. Final Answer:

    They group related content in a clear, boxed layout. -> Option A
  4. Quick Check:

    Cards organize content clearly = C [OK]
Hint: Cards group content visually in boxes for clarity [OK]
Common Mistakes:
  • Thinking cards change background color automatically
  • Believing cards hide images or text
  • Confusing cards with page-wide styles
2. Which of the following is the correct Bootstrap class to create a card container?
easy
A. .container-card
B. .card
C. .box-card
D. .card-container

Solution

  1. Step 1: Recall Bootstrap card class

    The official Bootstrap class for cards is .card.
  2. Step 2: Verify other options

    Other class names like .container-card or .box-card are not valid Bootstrap classes.
  3. Final Answer:

    .card -> Option B
  4. Quick Check:

    Bootstrap card class = .card [OK]
Hint: Bootstrap cards use the class .card for containers [OK]
Common Mistakes:
  • Using incorrect class names like .container-card
  • Confusing card container with layout containers
  • Adding extra words to the class name
3. What will the following Bootstrap card code display in the browser?
<div class="card" style="width: 18rem;">
  <img src="image.jpg" class="card-img-top" alt="Sample Image">
  <div class="card-body">
    <h5 class="card-title">Card Title</h5>
    <p class="card-text">This is some text inside the card.</p>
    <a href="#" class="btn btn-primary">Click Me</a>
  </div>
</div>
medium
A. A box with an image on top, a title, text, and a blue button inside.
B. Only a blue button with no text or image.
C. Just a plain text paragraph with no styling.
D. An image with no text or button below it.

Solution

  1. Step 1: Analyze card structure

    The card has an image on top, a body with a title, text, and a button styled with Bootstrap classes.
  2. Step 2: Understand Bootstrap styling

    The btn btn-primary class creates a blue button, and the card groups all content in a box.
  3. Final Answer:

    A box with an image on top, a title, text, and a blue button inside. -> Option A
  4. Quick Check:

    Card shows image, text, button = A [OK]
Hint: Look for .card-img-top, .card-title, and .btn-primary classes [OK]
Common Mistakes:
  • Ignoring the image or button presence
  • Thinking button is not styled
  • Assuming text is missing
4. Identify the error in this Bootstrap card code snippet:
<div class="card">
  <div class="card-body">
    <h5 class="card-title">Title</h5>
    <p class="card-text">Text here</p>
  </div>
  <img src="pic.jpg" class="card-img-top" alt="Image">
</div>
medium
A. The card-title class is invalid and should be removed.
B. The card class must be applied to the image, not the div.
C. The card-text class should be on the div, not the paragraph.
D. The image should be placed before the card body inside the card.

Solution

  1. Step 1: Review Bootstrap card image placement

    Bootstrap expects the image with card-img-top to be placed before the card body for correct layout.
  2. Step 2: Check other classes usage

    The card-title and card-text classes are correctly used on heading and paragraph respectively.
  3. Final Answer:

    The image should be placed before the card body inside the card. -> Option D
  4. Quick Check:

    Image placement before body = B [OK]
Hint: Place .card-img-top before .card-body inside .card [OK]
Common Mistakes:
  • Putting image after card body breaks layout
  • Removing valid card-title or card-text classes
  • Misapplying card class to image
5. You want to create a responsive Bootstrap card layout that shows three cards side by side on large screens but stacks them vertically on small screens. Which Bootstrap classes should you use to organize the cards correctly?
hard
A. Use grid with three col-4 col-12 cards inside.
B. Use container with three card-lg-4 card-12 inside.
C. Use row with three col-lg-4 col-12 cards inside.
D. Use flex-row with three card-4 card-12 inside.

Solution

  1. Step 1: Understand Bootstrap grid for responsiveness

    Bootstrap uses row and col-* classes to create responsive layouts.
  2. Step 2: Choose correct column classes for screen sizes

    col-lg-4 makes each card take 1/3 width on large screens, and col-12 makes them full width on small screens, stacking vertically.
  3. Final Answer:

    Use row with three col-lg-4 col-12 cards inside. -> Option C
  4. Quick Check:

    Responsive columns use col-lg-4 and col-12 inside row = D [OK]
Hint: Combine row with col-lg-4 and col-12 for responsive cards [OK]
Common Mistakes:
  • Using incorrect class names like card-lg-4
  • Confusing flex-row with Bootstrap grid row
  • Using grid without proper Bootstrap classes
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