Firefox adding padding to first image in multiple images, although all images have same styling and size.

Posted by Sam Gabriel on Stack Overflow See other posts from Stack Overflow or by Sam Gabriel
Published on 2010-12-31T11:18:06Z Indexed on 2010/12/31 11:53 UTC
Read the original article Hit count: 256

Filed under:
|
|

Hey guys, I have this piece of code:

while($uno=mysql_fetch_assoc($results)) {
    echo '<div class="wcapt"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img class="pad" src="'. $uno['thumbs'].'" border="0" /></a><br/><center><p>'.$uno['name'].'</p></center></div>';
}

And all the images I link to have exactly the same size. Here's the Mainstyles.css

div.wcapt
{
    border: 1px solid green;
    float: left;
    padding: 0;
    margin: 3px;
    font: 11px/1.4em Arial, sans-serif;
    color: gray; 
    }
img.pad
{
    padding: 5px;
    }
a.neutral
 {
    display: inline;
    font-weight: normal;
    text-transform: none;
    background-color: transparent;
    color: white;
    text-decoration: none;
    }   

The problem is that Firefox adds some extra padding to the first image, and only the first image. And this is really annoying. Here's a screenshot of the page: alt text

© Stack Overflow or respective owner

Related posts about php

Related posts about html