【发布时间】:2013-04-10 15:28:45
【问题描述】:
这段代码有什么问题?我已经为此工作了几个小时,无法弄清楚为什么 button.png 现在会显示,但链接在“one” div 的位置..?
#one
{
position: fixed;
left:225px;
top:702px;
}
.button
{
display: block;
width: 40px;
height: 40px;
background: url('images/button.png') bottom;
text-indent: -99999px;
}
.button:hover
{
background-position: 0 0;
background-color: transparent;
border-style: none;
}
_
<body>
<div id="map">
<img src="images/map.png"/>
</div>
<div id="one">
<a class="button" href="images/one.jpg"/>
<img src="images/button.png"/>
</a>
</div>
</body>
【问题讨论】:
-
您的目标是什么?目前正在发生什么?
-
你为什么要设置链接的背景以及在链接中放置图像标签?看来您可以只使用背景图片(删除图片标签)。
-
您的 HTML 似乎无效,您已“双重关闭”锚标记。
标签: css image html button hover