2017-04-14 61 views
0

我有两个网站的背景,其中一个显示常规状态和悬停状态。该div是空的,宽度和高度设置为50px。我添加了填充以查看是否有帮助,但没有。空div和可点击的网址

<div class="container_12 clearfix"> 
<div class="grid_12"> 
<p id="footer-center"> 
<a href="#top" class="top-btn" id="back-to-top"><div class="hover-btn"></div><!--<img src="images/back-to-top-a.png" class="a">--></a> 
</p> 
</div> <!-- end grid_4--> 
</div> <!-- end container_12 --> 


.hover-btn{ 
display:block; 
width:50px; 
height:50px; 
margin-left:50%; 
} 

.hover-btn{ 
background:url(../images/back-to-top-a.png) no-repeat center 
center; 
} 

.hover-btn:hover{ 
background:url(../images/back-to-top-b.png) no-repeat center center, url(../images/back-to-top-a.png) no-repeat center center; 
+1

什么是您的查询? – amarnath

+0

感谢Saeed Ludeen的工作代码 NCweb

+0

工作代码感谢Saeed Ludeen .hover-btn \t display:block; \t width:50px; \t height:50px; \t margin-left:50%; } .hover-btn:hover { \t background:url(../ images/back-to-top-b.png)no-repeat center center; } – NCweb

回答

0

只需使用img标签更换悬停BTN格会显示您的第一个图像,然后在第二上徘徊。

<img src="" class="hover-btn"> 
+0

非常感谢。 – NCweb