Incorrect borders with .list-group-flush.list-group-horizontal
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
When using .list-group-flush and .list-group-horizontal on the same list group you get:
But was expecting:
Documentation seems to say that this is possible:
Add
.list-group-flushto remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).
I have seen another issue about putting a list group IN a list group. But that is not what is being reported here.
Workaround (how I made the second screenshot) is to add .border-0 on each .list-group-item
Reduced test cases
<!-- a card with a link list group -->
<div class="card" style="width: 18rem;">
<div class="card-header">
Featured
</div>
<div class="list-group list-group-flush list-group-horizontal">
<a href="#" class="list-group-item list-group-item-action">Certificates</a>
<a href="#" class="list-group-item list-group-item-action">Products</a>
<a href="#" class="list-group-item list-group-item-action">AHA</a>
</div>
</div>
<hr>
<!-- a card with a link list group -->
<div class="card" style="width: 18rem;">
<div class="card-header">
Featured
</div>
<div class="list-group list-group-flush list-group-horizontal">
<a href="#" class="list-group-item list-group-item-action border-0">Certificates</a>
<a href="#" class="list-group-item list-group-item-action border-0">Products</a>
<a href="#" class="list-group-item list-group-item-action border-0">AHA</a>
</div>
</div>
Edit: CodePen created by @julien-deramond: https://codepen.io/julien-deramond/pen/rNoWJxg
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
Microsoft Edge
What version of Bootstrap are you using?
5.3.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reduced HTML test case or the linked CodePen, then trace the Bootstrap styles applied by .list-group-flush and .list-group-horizontal. Reproduce the border mismatch in Bootstrap 5.3.1 and verify that the combined classes render the expected borderless horizontal list without requiring .border-0 on each item.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, scss
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100