Why button is spread out when parent element display is flex
-
normal button is like this
but when set button’s parent element is flex, it’s change to this:
button spread out so I can’t use
display: flex
width button? -
Its because the parent is set to have a
align-items:stretch
which stretches all the elements so they have the same position. You have to do aalign-items:center
or use theitems-center
class on the parent. -
@Dobromir It’s works, thank you.