Hi there
This is my jsfidddle.net
http://jsfiddle.net/vngx/075r2sqq/
How to make any html element center horizontal true?
thanks
Hi there
This is my jsfidddle.net
http://jsfiddle.net/vngx/075r2sqq/
How to make any html element center horizontal true?
thanks
margin: auto
only works on block-level elements. E.g.
#demo_but{margin-left:auto;margin-right:auto; display:block}
However, Iām not too keen on setting an input to block display. So the alternative would be to set a container to text-align: center
instead.
The input button wants to be inside a container:
<!doctype html>
<html>
<head>
<style type="text/css">
.tac {text-align:center;}
</style>
</head>
<body>
<div class="tac">
<input type="button" value="Submit" />
</div>
</body></html>
Ninjared by @ralphm
thanks
this is working for me
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.