0
0
Bootsrapmarkup~20 mins

Card structure (header, body, footer) in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Card Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
1:30remaining
What will this Bootstrap card display?
Look at the Bootstrap card code below. What text will appear inside the card header?
Bootsrap
<div class="card" style="width: 18rem;">
  <div class="card-header">
    Featured
  </div>
  <div class="card-body">
    <h5 class="card-title">Special title treatment</h5>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  </div>
  <div class="card-footer text-muted">
    2 days ago
  </div>
</div>
AFeatured
B2 days ago
CSpecial title treatment
DWith supporting text below as a natural lead-in to additional content.
Attempts:
2 left
💡 Hint
The card header text is inside the div with class 'card-header'.
🧠 Conceptual
intermediate
1:00remaining
Which Bootstrap class defines the card footer?
In Bootstrap, which class should you use to create the footer section of a card?
Acard-end
Bcard-body-footer
Cfooter-card
Dcard-footer
Attempts:
2 left
💡 Hint
Look for the class that starts with 'card-' and ends with 'footer'.
selector
advanced
1:30remaining
Which CSS selector targets only the card body text?
Given this HTML structure for a Bootstrap card, which CSS selector will select only the paragraph inside the card body?
Bootsrap
<div class="card">
  <div class="card-header">Header</div>
  <div class="card-body">
    <p class="card-text">Body text here</p>
  </div>
  <div class="card-footer">Footer</div>
</div>
A.card .card-text
B.card-body > p
C.card-footer p
D.card-header .card-text
Attempts:
2 left
💡 Hint
The paragraph is a direct child of the card-body div.
layout
advanced
1:30remaining
How to vertically center card footer text using Flexbox?
You want the text inside the card footer to be vertically centered. Which CSS style will achieve this using Flexbox?
Bootsrap
<div class="card-footer">Footer text</div>
Adisplay: flex; justify-content: center;
Bdisplay: block; vertical-align: middle;
Cdisplay: flex; align-items: center;
Ddisplay: grid; align-content: start;
Attempts:
2 left
💡 Hint
Flexbox aligns items vertically with 'align-items'.
accessibility
expert
2:00remaining
Which ARIA role best describes a Bootstrap card component?
For accessibility, which ARIA role is most appropriate to assign to a Bootstrap card element that groups related content?
Bootsrap
<div class="card" role="?">
  <div class="card-header">Header</div>
  <div class="card-body">Body content</div>
  <div class="card-footer">Footer</div>
</div>
Aarticle
Bregion
Cgroup
Dcomplementary
Attempts:
2 left
💡 Hint
The card is a self-contained piece of content that can stand alone.