This is just a suggestion.
Try it with a div and see if it still happens.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!DOCTYPE html><html><head><title></title><style>
#field{padding:20px 20px 20px 20px;background-color:#ff00ee;height:150px;width:600px;border:ridge 1px #cccccc;}
</style></head><body><div id ="field"><form><legend></legend><p><label for="name">Name </label><input id="name" type="text"></p><p><label for="email">Email </label><input id="email" type="text"></p></form></div></body></html>
fieldset+legend padding-top is a mess in IE.
All padding-top values appear ABOVE the legend, thus pushing the entire fieldset box down (i.e. just like margin-top)
The easiest solution is to use <!--[if IE conditionals, and redefine the CSS for IE ONLY as:
fieldset {padding-top: 0}
legend {margin-bottom: 15px}
...yeah, I know, if IE conditionals are very ugly hacks, but the only way you'll get that space in the top of the box is adding it as margin-bottom to legend.
OR, you can drop the padding for fieldset altogether, then wrap the contents in a div block with its own padding/margin. Haven't tried it that way, but it should work, and it should be cleaner.
OR, you can drop the padding for fieldset altogether, then wrap the contents in a div block with its own padding/margin. Haven't tried it that way, but it should work, and it should be cleaner.
Bookmarks