0

Hi,

I have a page that gets adverts and an image from mysql database. Getting the results is no problem.
How do I make use of css to align each advert next to each other as opposed to every advert under one another.

I also have a problem of the results going over the footer.

 while ($row = mysqli_fetch_assoc($sports)) {        

          echo "<b>" . $row['AdvertTitle'] . "<br/>";
          echo "<b>R <b/> " . $row['Price'] . "<br/>";
          echo "<b>" . $row['Description'] . "<br/>";         
          echo "<b></b><br/> <a href='" . $row['Link'] . "'><img src='" .$row['Link'] . "' width='150px;' height='150px'/></a><br/><br/>";
             }



 .categories
{
 height: 500px;
 width: 970px;
 margin-left: 5%;
 margin-top: 5%; 

}

Thanks,

Prince

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by BloccPrince
1

maybe you should try out this

while ($row = mysqli_fetch_assoc($sports)) {   
        echo "<div class='category'>";
          echo "<b>" . $row['AdvertTitle'] . "<br/>";
          echo "<b>R <b/> " . $row['Price'] . "<br/>";
          echo "<b>" . $row['Description'] . "<br/>";         
          echo "<b></b><br/> <a href='" . $row['Link'] . "'><img src='" .$row['Link'] . "' width='150px;' height='150px'/></a><br/><br/>";
         echo "</div>";    }

.category{
    width: 30%;
    display: inline-block;
    vertical-align: top;
    *display: inline;
    *zoom: 1;
}

and add overflow:hidden; to .categories.

Hope can solve your question. And, this question should be posted in CSS section. Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.