Jump to content

Positioning A Form Within A Div


MattDoherty
 Share

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

Thanks for the reply, but what I mean is that my text fields are in the position I'd like them to be, but when I click in the field itself, instead of being able to type in the field, nothing happens. It's strange because it works fine in IE8 but not in Firefox.

Edited by MattDoherty
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
 Share

×
×
  • Create New...