views:

66

answers:

4

Any reason why I am getting extra spacing underneath each input on my contact form?

It only happens in ie6 and ie7

http://nhbs.bythepixel.com/contact.html

+3  A: 

probably newlines... ie tries to print "whitechars" between tags

Kamil Klimek
+1  A: 

IE sometimes treats whitespace (text nodes) as occupying space among floated elements. Don't freak out when I suggest this, but have you considered putting the input elements in a table? Yes, table-based layouts are horrible, except in this case your content is actually arranged in a table, so it would be perfectly appropriate.

Devin McCabe
freakin out right now....!!! aahhh. hehe jk, to be honest i would like to avoid using tables. if anything I would rather stick it in an unordered list.. but thats so much extra un-needed code.. just like a table structure would be ya know?
Roeland
A: 

I tested. Just use this code for IE in conditional stylesheet if u are using

FORM#contactform .input { margin-bottom: -11px; }

or put in head directly like this code

<!--[if lte IE 7]>
<style type="text/css" media="screen">
 FORM#contactform .input { margin-bottom: -11px; }
</style>
<![endif]-->

It's a IE bug you can see more details here:

http://www.positioniseverything.net/explorer/inherited_margin.html

http://forums.devshed.com/css-help-116/margin-bug-in-ie7-a-kind-of-the-double-margin-548527.html

metal-gear-solid
A: 

Adding this to your page (or move the style to an IE only stylesheet) and it will fix your problem:

<!--[if lte IE 7]>
<style type="text/css" media="screen">
  #contactform { height: 1% }
</style>
<![endif]-->

Working example here (View in IE6 or IE7)

Doug Neiner
no it's not a solution , it's not a IE double margin bug it's different. IE double margin bug is only for Horizontal margin not vertical
metal-gear-solid
@Jitendra, good point! I changed it to `height: 1%` and it took care of the issue.
Doug Neiner
yes now it's correct. mine and your both solution will work
metal-gear-solid