Jump to content

Positioning A Form Within A Div


MattDoherty

Recommended Posts

I've searched using Google extensively and I can't seem to find an answer. I want to position a form using a DIV but when I wrap the form in my DIV, the text input bars become inaccessible. Any help would be appreciated.CSS:

.commentform{  width: 415px;  height: 370px;  position: relative;  top: -1250px;  left: 525px;}

HTML:

<div class="commentform">  <form action="submit.html">	Name:	<br>	  <input type="text" name="name">	<br>	Company:	<br>	  <input type="text" name="company">	<br>	  email:	<br>	  <input type="text" name="email">	<br>	  Comments and/or Questions:	<br>	  <textarea rows="4" cols="50" name="comments">		Enter Comments or Questions Here	  </textarea>	<br>	  <input type="submit" value="Submit">  </form></div>

Link to comment
Share on other sites

Hm, why has the div got such a large negative top position? If you mean that the inputs are out of the viewport, that's why.I've put forms inside divs and it works fine. Try closing your inputs:<input type="text" name="name" />It'd take a fussy browser to make them not work, though.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...