<分区>
关闭 7 年前。
- 编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
- 这个问题是由于打字错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助 future 的读者。
<分区>
关闭 7 年前。
我完全是 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;
}
最佳答案
我只是在适当的地方添加了一个 Angular 括号,它似乎解决了这两个问题。参见 JSFiddle here .
<html>
<body>
<div>
<a id="button" href="http://mysite.com"></a> <!--Notice extra corner bracket-->
</div>
</body>
</html>
关于html - 按钮图片显示不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15029258/