2017-01-27 50 views
0

我有一個橫幅出現在html中作爲背景。圖像寬約900px,高150px。我需要包含大約4個鏈接的html文本才能放在此橫幅的頂部。問題在於它會在chrome中正確顯示鏈接,但是在IE中它們一直在頁面上。任何有關如何解決這個問題的建議,而不會影響背景圖像的設計理念。在ie和chrome瀏覽器的橫幅上使文本顯示

#linkage{ 
 

 
margin-left:700px; 
 
margin-top:60px; 
 
} 
 
#links{ 
 
height:20px; 
 
width:280px; 
 
background-repeat: no-repeat; 
 
color: black; 
 

 
} 
 

 

 
#bannerHead{ 
 

 
    background-image: url("https://placehold.it/900x200"); 
 

 
} 
 
#linkid{ 
 

 
color: black; 
 
} 
 

 
#linkid2{ 
 

 
color: black; 
 
} 
 

 
#linkid3{ 
 

 
color: black; 
 
} 
 

 
#linkid4{ 
 

 
color: black; 
 
} 
 

 
a:link { 
 
    color: black; 
 
}
<div id="bannerHead"><img src="" style="margin-top:0px; margin-left:660px; width:200px;"/><div id="linkage" style="margin-top:-110px;"> 
 
<a href="#" id="linkid">Home</a>&nbsp;&nbsp;<a href="#" id="linkid2">About</a>&nbsp&nbsp

+1

您是否注意到您的代碼段不起作用?你能花5-10分鐘,至少能在那裏看到一個圖像嗎?您可以嘗試使用https://placehold.it/等服務,這樣可以非常簡單地將圖片添加到片段中。 –

+2

什麼版本的ie? –

回答

1

你的意思是這樣?

#bannerHead{ 
 
    width: 900px; 
 
    height: 150px; 
 
    background-image: url("http://placehold.it/900x150"); 
 
} 
 

 
a:link { 
 
    color: black; 
 
}
<div id="bannerHead"> 
 
    <a href="#">Home</a>&nbsp;&nbsp;<a href="#">About</a>&nbsp&nbsp<a href="#">Contact</a>&nbsp;&nbsp;<a href="#">Info</a> 
 
</div>

我所做的就是爲您的橫幅DIV的寬度和高度(如果不是它的大小是一樣大的內容,並且圖像沒有完全顯示),以及包括鏈接裏面。這是你想要做的嗎?

我測試了這個Internet Explorer 6它的工作原理。我遇到的唯一問題是「placehold.it」鏈接。我使用了一個普通的圖像。

相關問題