html - How to center a button WITHOUT a div using CSS -


i trying center button without div. button follows

<body>   <button>some text</button> </body> 

i have tried using few different techniques such as:

text-align: center 

and

margin:0 auto;  

but these don't work.

its simple, make display block element:

<body>   <button>some text</button> </body>  button {     display: block;     margin: 0 auto; } 

http://jsfiddle.net/df216mho/


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -