Forum Moderators: open
Do forms add their own padding automatically? I'm familiar with CSS, just never encountered this with a form. I have collapsed the TD cells as much as possible so that's not what is doing it.
This occurs on the following Browsers:
Newest Safari, Netscape, Firefox on the Mac (on Opera there is also padding above the button which makes it even larger space). On Win XP IE 6 and Firefox it has padding below the buttons.
Anyone know how to prevent the extra space?
<table align="center" width="760" border="0" cellpadding="0" cellspacing="0">
<tr><td bgcolor="#009933" align="right" valign="middle"><form name="form1" method="post" action="http://www.EXAMPLEserver.com/sc/cart.cgi"><input type=hidden name=item2 value="a-2817"><input name=view type=image src="http://www.example.com/images/jbviewcart.gif"><img src="images/spacer.gif" width="42" height="20" border="0" alt="spacer"><input name=checkout type=image src="http://www.example.com/images/jbcheckout.gif"><img src="images/spacer.gif" width="130" height="20" border="0" alt="spacer"></form></td></tr></table>
However now those two buttons are moved way over to the left when I have that cell "align="right" and the background color disappeared too which was set for that cell.
Anyone know why this would happen?
Maybe I need to set the image at 0margins also, however I've never had success loading two classes on the same cell.
I therefore made a table just for this cell and now the buttons move to the right and there is now a green background like it should be but they still have too much padding below the buttons.
Here is the new and improved code: (I changed the name of form class to formimg in case "Form" is one of the words I can't use and used vertical align bottom in case it's the images messing this up.
<table align="center" width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#009933"><tr><td align="right" valign="bottom" class="formimg"><form name="form1" method="post" action="http://www.DOMAINserver.com/sc/cart.cgi"><input type=hidden name=item2 value="a-2817"><input name=view type=image src="http://www.DOMAIN.com/images/jbviewcart.gif"><img src="images/spacer.gif" width="42" height="20" border="0" alt="spacer"><input name=checkout type=image src="http://www.DOMAIN.com/images/jbcheckout.gif"><img src="images/spacer.gif" width="138" height="20" border="0" alt="spacer"></form></td></tr></table>
and the css:
.formimg {margin:0px; padding:0px; display:inline; vertical-align: bottom; }
Can anyone tell why there is still about 15px of padding under the buttons?
<table align="center" width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#009933"><tr><form name="form1" method="post" action="http://www.DOMAINserver.com/sc/cart.cgi"><td align="right" valign="bottom" class="formimg"><input type=hidden name=item2 value="a-2817"><input name=view type=image src="http://www.DOMAIN.com/images/jbviewcart.gif"><img src="images/spacer.gif" width="42" height="20" border="0" alt="spacer"><input name=checkout type=image src="http://www.DOMAIN.com/images/jbcheckout.gif"><img src="images/spacer.gif" width="138" height="20" border="0" alt="spacer"></td></form></tr></table>
Ugly but works. If you don't like that, you can remove the 20PX SPACER IMAGE and just center the button.