Html 使用css更改悬停时的背景图像url
我在每个报告页面的底部都有一个功能区,其中包含调用窗口的图像。print() 我是这样想的:Html 使用css更改悬停时的背景图像url,html,css,Html,Css,我在每个报告页面的底部都有一个功能区,其中包含调用窗口的图像。print() 我是这样想的: <div id="dgdPrint" class="hop"> <div id="dgdPrnImg" title="Print Report..." onclick="window.print();"> </div> </div> 但整个第一个div(ribbon)都会产生这种效果,当图像的任何部分悬停时,图像都会发生变化。我的代码出了什么问题?它
<div id="dgdPrint" class="hop">
<div id="dgdPrnImg" title="Print Report..." onclick="window.print();">
</div>
</div>
但整个第一个div(ribbon)都会产生这种效果,当图像的任何部分悬停时,图像都会发生变化。我的代码出了什么问题?它会发生变化,因为您有
背景图像:url('PrinterText-hover.png');}代码>设置在#dgdpnimg下:悬停
#dgdpnimg有一个背景图像,在它上面,它被更改为另一个图像,这是错误的吗?也许我没有正确理解你的问题。从我读到的,你在问你的代码出了什么问题,因为当你悬停在背景图像上时,背景图像发生了变化。“但是,第一个div(色带)的整体效果和图像改变的任何部分的悬停。我的代码中有什么错误?”DIVDGPRNIMG是DGDVDIVE DIV中间的35px div(100%个宽度div,是DGDPRNIMG的父)。但图像url在dgdPrint悬停时发生更改。你能说为什么吗?
#dgdPrint
{ position:fixed;
border-top:1px solid #000;
width:100%;
bottom:0;
right:0;
text-align:center;
height:55px;
margin-top:50px;
background-color:#88A7DB; }
#dgdPrnImg
{ margin-top:10px;
background-image:url('PrinterText.png');
background-position:center center;
background-repeat:no-repeat;
height:35px; }
#dgdPrnImg:hover
{ background-image:url('PrinterText-hover.png'); }