Page 1 of 1

auto padding of first fieldset in a for loop

Posted: Tue Jan 24, 2006 2:53 pm
by cannon_balls
Im trying to display an array of images using a for loop and inclosing the images in a fieldset.In the fieldset, there are also a couple of radio buttons Everything works fine on firefox, but on IE, the first image of the array is padded by about 20px at the top while the rest of the sides and the other pictures are ok. Ive been doing web dessign for a short while now but more and more everyday i seems to hate IE even more.

a sample of the code is

Code: Select all

<?php
for ($i=0; $i<3; $i++)				
{
$display1=	"<div class=\"float_left\"><fieldset style=\"width:180px\"><legend align=\"center\">Test</legend>		
			<form method=\"post\" action=\"code2.php\">
			<input type=\"radio\" name=\"pic1\" value=\"picture1\">";

echo $display1; 
to save space, here the image location is extracted from database and displayed using echo
}
?>
all that is contained in the class "float left" is (float: left;)


Any help/ suggestions would be greatly appreciated.

Posted: Tue Jan 24, 2006 5:13 pm
by Chris Corbyn
Do you have the styles of your <form> to use padding and margin as 0 ?

Code: Select all

<form style="padding: 0; margin: 0;">
....
IE adds default amounts of these unless you specify otherwise ;)

Posted: Tue Jan 24, 2006 5:33 pm
by cannon_balls
yeah. margin, border and padding are all set to none. still didnt work with that

Posted: Wed Jan 25, 2006 3:41 pm
by cannon_balls
Common guys, can someone please help me with this. ive spent hours on it and i cant get it to work.
pleasssssssssssssssssssssssssseeeeeee