Margin auto centering technique not working for button

I am trying to use the margin technique to center the button, but it isn’t working! it worked on the .container div, though. And i don’t want to use flexbox on it.
i want to know why.
Help someone, please.
Here is the link to the file on codepen:
https://codepen.io/samolex/pen/vYNbZer

The easiest way to do this is to change the button to display: block. Buttons are inline by default and thus the side margin auto trick won’t work on them until you change them to block.

2 Likes

Also, the <br> is no longer needed after the <label> when you change to display: block.

1 Like

thanks @ bbsmooth @ bradleyhop