Positioning of Divs

Asked

Viewed 209 times

2

I’m having a problem positioning the Ivs of the products they don’t align.

http://casimirowebshare.000webhostapp.com/nutrirossio/produtos.php

As you can see here in CSS I have:

.produto_em_destaque{
     display: table;
     width: 70%;
     float: right;}

.produtos_em_destaque{
     display: inline-table;
     width: 20%;
     height: 283px;
     text-align: center;
    }

In HTML I have:

<div id="produto_em_destaque" class="produto_em_destaque">
<?php
while($row = $result->fetch_assoc()) {
?>
<div class="produtos_em_destaque">
 <a href=<?php echo "produto.php?id=" . $row['id']; ?>>
 <img class="produtos_em_destaque_img" src=<?php echo "imagens/" . $row['imagem'] ?>>
<h4><?php echo $row['nome'] ?></h4>
<span><?php echo $row['preco'] ?>€</span>
</a>
</div>
<?php
}
?>
  • Are the images you place of each product with standard sizes? , note that on the last line that the images are all equal (of same height), the cited problem does not happen.

1 answer

2


In your case, with the use of the CSS property vertical-align setting the value top can solve it. But you might have to rethink the way you’re doing mobile compatibility.

  • is that thank you :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.