auto padding of first fieldset in a for loop

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cannon_balls
Forum Newbie
Posts: 10
Joined: Tue Jan 24, 2006 2:23 pm

auto padding of first fieldset in a for loop

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 ;)
cannon_balls
Forum Newbie
Posts: 10
Joined: Tue Jan 24, 2006 2:23 pm

Post by cannon_balls »

yeah. margin, border and padding are all set to none. still didnt work with that
cannon_balls
Forum Newbie
Posts: 10
Joined: Tue Jan 24, 2006 2:23 pm

Post 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
Post Reply