Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS to align a submit button?

Tags:

css

I have a submit button on a form tag is input, obviously. Text-align obviously does not work. I don't want to use margin-left because my width might change later on and I want it to be more "proper". Any way you can think of?

HTML:

<input type="submit" value="Subscribe" name="jetpack_subscriptions_widget">

CSS:

#blog_subscription-3 input[name="jetpack_subscriptions_widget"] {
   margin-left:25px;
}
like image 871
antonpug Avatar asked Dec 09 '11 17:12

antonpug


1 Answers

It works for me. I saw that some people forgot about display property.

#container input[type=button] 
{
    display: block;
    margin: 0 auto;
}
like image 74
Joseph Katzman Avatar answered Sep 27 '22 23:09

Joseph Katzman