2017-07-16 145 views
1

在文本超鏈接的時刻,當它消失到其它圖像的鏈接不再存在,你可以有第二圖像(它退色入鏈接的一個)文本超鏈接褪色成圖像也超鏈接

它似乎只有超文本鏈接,然後當圖像出現鏈接消失。

這裏是我的代碼 感謝

<!DOCTYPE html> 
<html> 
    <head> 
     <title>Page Title</title> 
    </head> 
    <body> 
<style> 
    div{ 
     background-image: url("http://#.com"); 
     height: 200px; 
     width:200px; 
     transition: background-image 0.7s ease-in-out; 
       transition: 0.6s ease-in-out; 
    } 
    #hello:hover{ 
     font-size:0px; 
     background-image: url('http://#.com'); 

    } 

    #hmv:hover{ 

     font-size:0px; 
     background-image: url("http://#.com"); 

    } 

    p{ text-align:center;font-size:3em;} 
</style> 

<div id="hello"> 

    <br> 

<a href="#"><p>Pottery</p></a> 
</div> 
<br> 
<div id="hmv"> 

    <br> 

<a href="#"><p>Silver</p></a> 
</div> 
    </body> 
</html> 
+0

可不可以給任何演示網址。然後澄清更好。 – Bipon

+0

什麼是你想達到什麼目的?能否請你澄清 –

+0

有什麼問題嗎? https://codepen.io/anon/pen/OgGXvr – Nivedita

回答

0

您更改字體大小爲0px懸停,這就是爲什麼文本消失,我註釋掉了字體大小線,檢查出來。

#hello:hover{ 
    /* font-size:0px; */ 
    background-image: url('http://#.com'); 

} 

#hmv:hover{ 

    /* font-size:0px; */ 
    background-image: url("http://#.com"); 

} 
+0

這一工程是有可能有文字移動到圖片的底部,顯示圖像更? –

+0

是的,你可以給p標籤填充,就像這樣, ' #hello:hover p, #hmv:hover p { padding-top:50%; }' –

+0

這非常適用的感謝! –