I have a problem. Whenever the text-wraps the h1 stays the original size making the icon float with quite some space on the right of the h1. What I would like is that the icon will always be directly next to the text even if the text wraps on a new line. Is this possible? To show what I mean you would have to switch your browser to responsive mode and resize the screen.
.container {
display: flex;
flex-direction: row;
}
<div class="container">
<h1>This is a long text for testing!</h1>
<i class="icon">icon</i>
</div>