<div style="display: inline-block; margin: 0 auto;"> <input id="abc" type="button" value="button" /> </div>
I am trying to use the code above to set the width of its equal content, and then center it using a field: 0 auto;
But this did not work for me in any browser. Any suggestion?
By the way, when I set the width property, it works fine.
<div style="width: 10em; margin: 0 auto;"> <input id="abc" type="button" value="button" /> </div>
html css
etlds Feb 16 2018-12-16T00: 00Z
source share