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 - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -