I do not know if I'm complicating my life. All I want is for the part where the percentage with the background color appears, appears aligned to the right, just like the numbers above. I am using display:flex
and justify-content:right
, that I understand that I should move all the content to the right, but it is not like that.
<div style="max-width:20%;display:flex;flex-wrap:wrap;">
<p class="old-price" style="width:100%;text-decoration: line-through;text-align:right;">19.99€</p>
<p class="current-price" style="width:100%;font-size:18px;text-align:right;margin-top:4px;">24.99€</p>
<div style="display:flex;flex-wrap:wrap;justify-content:right;width:100%;">
<div style="background:#ff5454;display:flex;padding:3px;margin-top:4px;width:55px;justify-content: right;" class="current-discount">
<p style="margin:auto;color:white;font-weight:500;">+21%</p>
</div>
</div>
</div>