我已以下HTML代碼:CSS圖像重疊在while循環
(此代碼創建圖像,產品名稱和基本描述框)
<?php
while ($row = mysql_fetch_row($q3)) {
echo "<div class='ipsBox_containerdlc ipsPad'>
<h3 class='ipsType_subtitledlc'>".$row[2]." </h3>
<br>
<p class='descdlc'>".$row[4]."</p>
<p class='descdlcimg'>
<img src='http://localhost/images/249273625.jpg' width='200' height='219'/>
</p></div>
";
}
?>
和CSS代碼:
.descdlc {
font-size: 12px;
color: #777777;
position:relative;
left:375px;
width:375px;
}
.descdlcimg {
font-size: 12px;
color: #777777;
position:relative;
top:-143px;
left:100px;
overflow:hidden;
}
.ipsBox_containerdlc {
background: #fff;
border-left: 1px solid #CECED1;
border-right: 1px solid #CECED1;
border-bottom: 1px solid #CECED1;
border-top: 1px solid #CECED1;
height:240px;
}
問題是我的圖像「重疊」,如果我使用while循環:
任何想法如何解決它? 沒有while循環一切看起來很好!
更新:
'top:-143px;'對於每張圖片肯定會將它們融合在一起 –