2012-10-02 60 views
0

我有這個頭在這裏...頭在不同broswers看起來不同

.header { 
    background-color: #FFFFFF; 
    padding-left: 16px; 
    width: 920px; 
} 

.logo { 
    background-color: #FFFFFF; 
    float: left; 
    padding-left: 10px; 
    padding-right: 20px; 
    width: 500px; 
} 

.phoneNumber { 
    background-color: #FFFFFF; 
    color: #44BAD2; 
    float: left; 
    font-size: 22px; 
    height: 94px; 
    line-height: 95px; 
    width: 155px; 
} 

.social { 
    background-color: #FFFFFF; 
    float: left; 
    font-size: 18px; 
    height: 69px; 
    padding-left: 10px; 
    padding-top: 25px; 
    width: 190px; 
} 

.social ul { 
    list-style-type: none; 
    margin: 0; 
    padding: 0 0 0 15px; 
} 

.social li { 
    float: left; 
} 

谷歌瀏覽器,它看起來不錯,但在Firefox,在左側和右側都太短了,你可以在http://www.surfthecurve.ca看到這

這裏也是HTML

<div class="header"> 

<div class="social"> 
<ul> 
<li class="facebook"> 
<a target="_blank" href="http://www.facebook.com/SurfTheCurve"></a> 
</li> 
<li class="twitter"> 
<a target="_blank" href="https://twitter.com/SurfCurveTutor"></a> 
</li> 
<li class="email"> 
<a target="_blank" href="mailto:[email protected]?subject=Website Enquiry"></a> 
</li> 
</ul> 
</div><!--social--> 

<div class="logo"> 
<a href="http://surfthecurve.ca/"><img src="http://surfthecurve.ca/wp-content/themes/twentyeleven/images/logo.jpg" width="500" border="0" /></a> 
</div><!--logo--> 

<div class="phoneNumber"> 
647.390.3070 
</div><!--phoneNumber--> 


</div><!--header--> 
+1

嘗試第一固定這些[驗證錯誤](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fsurfthecurve.ca%2F)。這往往是不一致的來源。如果這沒有幫助你發現你的問題給我們一個更新。 – noel

+1

在我的Chrome和Firefox上看起來完全一樣嗎? – geekman

回答

2

你需要清除漂浮在那裏。您可以使用clear:both或使用clearfix方法。

.clearfix:after { 
    content: "."; 
    display: block; 
    clear: both; 
    visibility: hidden; 
    line-height: 0; 
    height: 0; 
} 

.clearfix { 
    display: inline-block; 
} 

html[xmlns] .clearfix { 
    display: block; 
} 

* html .clearfix { 
    height: 1%; 
} 
+0

Ummm沒有出現工作,我添加了你發佈的代碼沒有工作....我做任何事情你張貼的代碼? – user1269625

+0

將clearfix代碼添加到底部的CSS。 將class =「header」修改爲class =「header clearfix」。 –

+0

感謝芝諾它工作:) – user1269625

相關問題