<div class="basic_layout">
<? while($row = mysqli_fetch_array($data)){?>
<div class="product_layout" onclick="location.href=URLLLL';">
<img class="product_icon opacity-black" src="<?=$row['icon'];?>">
<div class="product_brand">OOO</div>
<div class="product_name">XXXXXXXXXXXXXXXXXXXX</div>
<div class="product_price">SSSSSSS</div>
</div>
<?}?>
</div>
只有圖片會被順利排好
.product_layout{
width: 23%;
height: 255px;
margin: 15px 9px;
display: inline-block;
border-radius: 5px;
border: 1px #ccc solid;
cursor: pointer;
float: left;
}
每個div至少都會有三行以上的字
唯獨右邊沒有被遮住因為下面沒有div
其他完全都被遮住了
怎麼樣使他不遮住?
完整的div區塊?
我都訂高度255px了還這樣~直接略過文字區域...
改成這樣
.product_layout{
height: 300px;
width: 23%;
margin: 15px 9px;
float: left;
}
.product_layout2{
height: 255px;
width: 100%;
display: inline-block;
border-radius: 5px;
border: 1px #ccc solid;
cursor: pointer;
}
<div class="product_layout" onclick="location.href=URLLLL;">
<div class="product_layout2">
<img class="product_icon opacity-black" style="height:200px" src="https://ithelp.ithome.com.tw/storage/image/profile.jpg">
</div>
<div class="product_brand">OOO</div>
<div class="product_name">XXXXXXXXXXXXXXXXXXXX</div>
<div class="product_price">SSSSSSS</div>
</div>