I am facing a challenge with displaying text and an icon together in a div. The requirement is for the icon to always be positioned right next to the text, even when the text wraps due to limited space.
Various solutions have been attempted, but they all result in a gap between the text and the icon when the text wraps:
https://i.sstatic.net/K2H4M.png
The desired outcome looks like this:
https://i.sstatic.net/W1oO0.png
<div style="width: 200px;">
<div style="display: flex;">
<span>Erforderliche Gesamtsumme</span>
<span>🚀</span>
</div>
</div>
If you have any ideas on how to solve this issue using HTML/CSS only (no JS), I would greatly appreciate it. Various attempts including CSS Grid, display: inline-block, and different flex properties have not yielded successful results so far.