0
0
Bootsrapmarkup~20 mins

Card groups and decks in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Card Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual output of this Bootstrap card group code?
Given the following HTML code using Bootstrap 4, what will the cards look like when rendered in a modern browser?

<div class="card-group">
  <div class="card">
    <img src="img1.jpg" class="card-img-top" alt="Image 1">
    <div class="card-body">
      <h5 class="card-title">Card 1</h5>
      <p class="card-text">Text 1</p>
    </div>
  </div>
  <div class="card">
    <img src="img2.jpg" class="card-img-top" alt="Image 2">
    <div class="card-body">
      <h5 class="card-title">Card 2</h5>
      <p class="card-text">Text 2</p>
    </div>
  </div>
  <div class="card">
    <img src="img3.jpg" class="card-img-top" alt="Image 3">
    <div class="card-body">
      <h5 class="card-title">Card 3</h5>
      <p class="card-text">Text 3</p>
    </div>
  </div>
</div>
Bootsrap
<div class="card-group">
  <div class="card">
    <img src="img1.jpg" class="card-img-top" alt="Image 1">
    <div class="card-body">
      <h5 class="card-title">Card 1</h5>
      <p class="card-text">Text 1</p>
    </div>
  </div>
  <div class="card">
    <img src="img2.jpg" class="card-img-top" alt="Image 2">
    <div class="card-body">
      <h5 class="card-title">Card 2</h5>
      <p class="card-text">Text 2</p>
    </div>
  </div>
  <div class="card">
    <img src="img3.jpg" class="card-img-top" alt="Image 3">
    <div class="card-body">
      <h5 class="card-title">Card 3</h5>
      <p class="card-text">Text 3</p>
    </div>
  </div>
</div>
AA single card with three images stacked inside it vertically.
BThree cards stacked vertically with images stretched to full width.
CThree cards displayed side by side with equal height and their images aligned horizontally.
DThree cards displayed side by side but with different heights and images not aligned.
Attempts:
2 left
💡 Hint
Think about how Bootstrap's card-group arranges cards in a row with equal height.
🧠 Conceptual
intermediate
1:30remaining
Which Bootstrap class creates a deck of cards with equal width and spacing?
You want to create a set of cards that automatically adjust their width to fill the container evenly with consistent spacing. Which Bootstrap class should you use?
Acard-deck
Bcard-group
Ccard-columns
Dcard-container
Attempts:
2 left
💡 Hint
This class was designed to create equal width cards with spacing between them.
selector
advanced
2:00remaining
Which CSS selector targets only the card titles inside a Bootstrap card deck?
Given a Bootstrap card deck with multiple cards, which CSS selector will style only the card titles inside the deck?
Bootsrap
<div class="card-deck">
  <div class="card">
    <div class="card-body">
      <h5 class="card-title">Title 1</h5>
    </div>
  </div>
  <div class="card">
    <div class="card-body">
      <h5 class="card-title">Title 2</h5>
    </div>
  </div>
</div>
A.card .card-title
B.card-deck > .card-title
C.card-body > .card-title
D.card-deck .card-title
Attempts:
2 left
💡 Hint
Think about selecting elements inside the card deck container.
layout
advanced
2:00remaining
What happens if you put cards inside a Bootstrap card-columns container?
You use the following code:

<div class="card-columns">
  <div class="card">Card 1 content</div>
  <div class="card">Card 2 content</div>
  <div class="card">Card 3 content</div>
</div>

How will the cards be arranged visually?
Bootsrap
<div class="card-columns">
  <div class="card">Card 1 content</div>
  <div class="card">Card 2 content</div>
  <div class="card">Card 3 content</div>
</div>
ACards are arranged in a masonry-like column layout with varying heights.
BCards are arranged side by side with equal width and height.
CCards are stacked vertically with no spacing.
DCards overlap each other with images hidden.
Attempts:
2 left
💡 Hint
This container creates a Pinterest-style layout.
accessibility
expert
2:30remaining
Which ARIA attribute improves accessibility for a Bootstrap card group?
You want to make a Bootstrap card group more accessible for screen readers. Which ARIA attribute is best to add to the card group container?
Bootsrap
<div class="card-group">
  <!-- multiple cards here -->
</div>
Arole="list"
Baria-label="Group of related cards"
Caria-hidden="true"
Drole="presentation"
Attempts:
2 left
💡 Hint
Think about describing the group meaningfully to assistive technologies.