My task is to align two span elements, one with the Bootstrap 4 class 'close' and the other with class 'badge', to the right. However, whenever I try to float the badge to the right, they end up right next to each other. On the other hand, if I use clear: right, the badge falls to the end of the div.
Here is the structure I am aiming for:
https://i.sstatic.net/YSMyK.jpg
Below is the HTML code I have constructed so far:
<div class="card">
<div class="card-header">
<span class="close">x</span>
<img src="image.png">
<h1 class="card-title d-inline">Title</h1>
<span class="badge badge-default d-inline">Badge</span>
<h2 class="card-subtitle">Subtitle</h2>
</div>
</div>
Is there a way I can achieve this layout using Bootstrap 4? Any assistance is appreciated. Thank you!