0
0
Bootsrapmarkup~20 mins

Accordion flush variant in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Accordion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual difference of the accordion-flush class in Bootstrap Accordion?
Consider a Bootstrap accordion with and without the accordion-flush class. What visual effect does accordion-flush produce?
AIt removes the default background and borders between accordion items, making them flush with the parent container edges.
BIt adds extra padding and shadows around each accordion item for emphasis.
CIt changes the accordion headers to use a different font and color scheme.
DIt disables the collapse animation and makes all items always expanded.
Attempts:
2 left
💡 Hint
Think about how the accordion items look when they are 'flush' against each other and the container.
📝 Syntax
intermediate
2:30remaining
Which Bootstrap accordion markup correctly applies the flush variant?
Given the following options, which snippet correctly uses the flush variant of Bootstrap accordion?
A
<div class="accordion" id="accordionFlushExample">
  <div class="accordion-item flush">
    <h2 class="accordion-header" id="flush-headingOne">
      <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="true" aria-controls="flush-collapseOne">
        Accordion Item #1
      </button>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse show" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">Content for item 1.</div>
    </div>
  </div>
</div>
B
<div class="accordion accordion-flush" id="accordionFlushExample">
  <div class="accordion-item">
    <h2 class="accordion-header" id="flush-headingOne">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
        Accordion Item #1
      </button>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">Content for item 1.</div>
    </div>
  </div>
</div>
C
<div class="accordion flush" id="accordionFlushExample">
  <div class="accordion-item">
    <h2 class="accordion-header" id="flush-headingOne">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
        Accordion Item #1
      </button>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">Content for item 1.</div>
    </div>
  </div>
</div>
D
<div class="accordion-flush" id="accordionFlushExample">
  <div class="accordion-item">
    <h2 class="accordion-header" id="flush-headingOne">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
        Accordion Item #1
      </button>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">Content for item 1.</div>
    </div>
  </div>
</div>
Attempts:
2 left
💡 Hint
The flush class must be on the main accordion container, combined with the base accordion class.
selector
advanced
2:00remaining
Which CSS selector targets only the flush variant accordion items in Bootstrap?
You want to style only the accordion items inside a flush variant accordion. Which selector correctly targets them?
A.accordion .accordion-item.accordion-flush
B.accordion-item.accordion-flush
C.accordion-flush > .accordion-item
D.accordion-flush .accordion-item
Attempts:
2 left
💡 Hint
Remember flush is a class on the container, not on the items themselves.
layout
advanced
2:00remaining
How does the accordion-flush variant affect the layout spacing of accordion items?
What layout change happens to accordion items when using the flush variant compared to the default accordion?
AIt changes the accordion to use CSS grid layout instead of flexbox.
BIt adds extra margin between items to separate them visually.
CIt removes the default margin and border radius, making items align tightly without gaps.
DIt increases the padding inside each accordion header for better spacing.
Attempts:
2 left
💡 Hint
Flush means no extra space or border around items.
accessibility
expert
2:30remaining
Which ARIA attribute is essential for accessibility in a Bootstrap flush accordion button?
In a flush variant accordion, which ARIA attribute on the button ensures screen readers know the expanded state of the item?
Aaria-expanded
Baria-hidden
Caria-pressed
Daria-label
Attempts:
2 left
💡 Hint
This attribute toggles between true and false to indicate if content is visible.