Jump to content

cannot center the form


Recommended Posts

I have a form and I want to put it in the center of the page. Usually when I want to center an element I use margin:0px auto; Now, with the form though, it does not work. I am going to depict the code and to inform also that the form is enclosed in another wrap div tag which serves as the main wrapper of the page. Here it is:

 #wrap{    width:100%;    margin-left:auto;    margin-right:auto;    position: relative;    font-size: 0.875em;    overflow:hidden;}#form {margin:0px auto;}


<div id="wrap">  	  <form id="form" action="" method="post">	  Username/e-mail:<input   name="Username" type="text" size="35" /><br />Password:<input name="password" type="password" size="35" /><br /><input name="submit" type="button" value="submit" />	  </form>       </div>

  • Like 1
Link to comment
Share on other sites

Yes now it works,thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...