I'm using bootstrap-icons, which does not yet have an "unsorted" icon like this:

So I'd like to stack two separate icons to achieve that effect:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css" rel="stylesheet">
<span class="d-inline-block position-relative" style="height: 1rem; width: 1rem;">
<i class="bi bi-caret-up position-absolute" style="font-size: 1rem; top: -5px;"></i>
<i class="bi bi-caret-down position-absolute" style="font-size: 1rem; top: 5px;"></i>
</span>
Run that code snippet, and open it in your browser's devtools - you'll notice the parent wrapper does not properly fit the contents. The parent <span>
is smaller than the individual <i>
icons. So when used in a table header cell (and other places too), it sometimes looks weird.
How could I fix this?