我在这个问题上完全被阻止了,我正在使用 CMS,我正在生成文章,我希望它们在两个列中,所以
这是html代码(我删除了一些php部分以免混淆您):
<div id="contenu_col">
<?php
echo '<div class="col1">
<a href="exhibition.php?ID='.$ID.'"><img src="square/'.$IMGACSQ.'" ></a><br/>
<p><a href="exhibition.php?ID='.$ID.'">'.aff($DATE).'<br/>'.aff($nom_projet).' - '.aff($ARTISTE).'</p></a></div>';
</div>
生成一个看起来像这样的html代码:
<div class="col1">
<a href="exhibition.php?ID=109">
<img src="square/E_3094_x.jpg" >
</a><br/>
<p><a href="exhibition.php?ID=109">11.12. - 29.01.11.<br/>New impressions - New works - new artists - new space 5 and a happy new year)</p></a>
</div>
<div class="col1">
<a href="exhibition.php?ID=108">
<img src="square/BG_IoanGrosu06_x.jpg" >
</a><br/>
<p><a href="exhibition.php?ID=108">30.10. - 04.12.10.<br/>Come here tomorrow - Ioan Grosu</p></a></div>
和CSS:
.col1{
width:300px;
float:left;
padding: 3%;
display: block;
}
.col1 img{
width:100%;
}
.col1:after{
clear: both;
}
#contenu_col {
width:850px;
top:150px;
z-index:50;
left:460px;
position:absolute;
padding-bottom: 20px;
}
#contenu_col img{
width:100%;
}
(因为我不能发图片...)
它适用于网站的 70%;然后有时会出现一些奇怪的差距......我不明白我做错了什么:(
已解决。谢谢!