I want to make the button label such as
<button style="width:80px">← back <button>
then I want to put the ←
at the left and set back
in the middile of button.
such as
____________
|← back |
I think I should use Flex ,but a little bit confused, because
←
should be at the left
back
should be in the middle of button
itselt not a remaining space
How can I make this?
I think you could use another approach with position absolute and align the text at center
With this you will achieve two things
<button>
<span class="arrow">←</span>
<span class="text">back</span>
</button>
button {
position: relative;
width: 100px;
text-align: center;
}
button .arrow {
position: absolute;
left: 5px;
}