Jump to content

cannot center the form


jimfog

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;}

The HTML:

<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>

Link to comment
Share on other sites

Yes now it works,thanks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...