我已以下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;'对于每张图片肯定会将它们融合在一起 –