0

我完全是 CSS/HTML 菜鸟。如果您能帮助我,我将不胜感激。

我需要修复我的按钮:

  • 将激活字段(悬停)减小到按钮的实际大小(没有阴影)
  • 当我将光标悬停在按钮上时,如何去除剩余的第一张图像?

谢谢你!

jsfiddle链接:

http://jsfiddle.net/cRqhT/125/

HTML:

<html>
    <body>
        <div>
<a id="button" href="http://mysite.com"</a>
            </div>
        </body>
    </html>

CSS:

div {
    width: 820px;
    height: 820px;
    background: url('https://gator1174.hostgator.com/~mskparik/facebook/thx.jpg')
}

#button{
  display: block;
    width: 204px;
    height: 116px;
    background: url(https://gator1174.hostgator.com/~mskparik/facebook/111.png) no-repeat top left;
    position: absolute;
    top: 90%;
    left:10%;
}
#button:hover {
    background: url(https://gator1174.hostgator.com/~mskparik/facebook/222.png) no-repeat top;
    }
4

1 回答 1

1

我只是在适当的地方添加了一个角括号,它似乎解决了这两个问题。请参阅此处的JSFiddle 。

<html>
    <body>
        <div>
            <a id="button" href="http://mysite.com"></a> <!--Notice extra corner bracket-->
        </div>
    </body>
</html>
于 2013-02-22T17:01:21.500 回答