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?
2
Answers
You can indeed use
Flexbox
. The key is to use a combination ofjustify-content
andmargin
properties to place the arrow to the left and the text in the center.I think you could use another approach with position absolute and align the text at center
With this you will achieve two things