2013-08-25 31 views
0

我完全阻断在这个问题上,我与CMS的工作,和我生成的文章,我希望他们两个colums,所以与浮动怪异的差距离开

下面是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%;那么有时会出现一些奇怪的差距.... 我不明白我在做什么错:(

RESOLVED.THANK你!

似乎因为.col1高度不统一
+0

你能更具体地了解“怪异的差距”吗? – DevlshOne

+0

你可以在网址上看到他们,我无法发布图片,因为我太新了! – Dikeneko

+0

请不要结合多个问题请... –

回答

1

编辑您的COL1类,并添加一个高度,例如height:300px;

.col1 { 
    width: 300px; 
    float: left; 
    padding: 3%; 
    display: block; 
    height: 300px; 
} 

而且你DIV#encar不是很好的风格。

0

,尝试它添加到你的CSS

.col1{ 
    height: some value 
} 
+0

谢谢,就是这样! – Dikeneko