The application I'm working with has a piece of HTML code styled using flex that is present in multiple places to visualize several pop-up messages. The messages have a closing icon in the upper right corner.
However, depending on the length of the message within the <p>
element, the distance between the text and the closing icon changes. For instance, if the text has multiple lines or longer words, the <p>
element takes up more space, the distance between the text and the closing icon increases, and I can't figure out why.
How do I ensure a uniform distance between them?
<div style="display:flex; align-content:stretch;" id="aProductDraftUpdating>
<p style="margin: 0px; flex:1 1 auto">
"Editing the product draft continues from the last altered step.
Editing the product draft continues from the last altered step."
</p>
<i class="icons iconClose" role="link" style="flex:1 1 auto;" onClick="methodThatRemovesTheMessage(aProductDraftUpdating)">
::before
</i>
</div>