So, I am building a banner, the content needs to be responsive.
I am using flex
with center
. But the issue is the dollar amount needs to be centered and not the $+dollar amount.
I have tackled this with a negative margin, but it is clunky. I was wondering is the was a way to mark the $ as not included in the center calculation.
.flex-center {
padding: 3rem;
border: 1px solid black;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 2rem;
}
.offer {
font-size: 3rem;
font-weight: bold;
}
.offer sup {
font-size: 2rem;
}
<div class="flex-center">
<div>Some normal text</div>
<div class="offer"><sup>$</sup>250</div>
<div>Text</div>
</div>