我使用了滑动门技术,这里解释道:
http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html
除了一个例外,我决定为“悬停”效果再添加一个图像。
我的代码适用于所有浏览器,但IE8除外(可能更早版本)。
提交按钮:active和a.Submit-按钮:活动范围被“悬停”所阻塞,永远不会工作。
有人知道解决这个问题的办法吗?
这是测试页面:http://websvit.com/temp/button.html
提前谢谢!
<style type="text/css">
.clear { /* generic container (i.e. div) for floating buttons */
overflow: hidden;
width: 100%;
}
a.submit-button {
background: transparent url('images/button-1b.png') no-repeat scroll top right;
color: #fff;
display: block;
float: left;
font: bold 13px sans-serif, arial;
height: 28px;
margin-right: 6px;
padding-right: 18px; /* sliding doors padding */
text-decoration: none;
outline: none;
}
a.submit-button span {
background: transparent url('images/button-1a.png') no-repeat;
display: block;
line-height: 14px;
padding: 6px 0 8px 24px;
}
a.submit-button:hover {
background-position: right -28px;
outline: none; /* hide dotted outline in Firefox */
color: #fff;
}
a.submit-button:hover span {
background-position: 0px -28px;
}
a.submit-button:active {
background-position: right -56px;
color: #e5e5e5;
outline: none;
}
a.submit-button:active span {
background-position: 0px -56px;
padding: 7px 0 7px 24px; /* push text down 1px */
}
</style>这个按钮是:
<div class="clear">
<a class="submit-button" href="#" onclick="this.blur();"><span>Hello All</span></a>
</div>alt文本http://websvit.com/temp/button-1a.png alt文本http://websvit.com/temp/button-1b.png
发布于 2010-05-10 15:56:55
所有浏览器,除了IE8 (可能更早的版本)。
我在IE7查过了你和你的长官。IE6执行正常,但您有一个令人讨厌的png透明度问题。
您可以尝试使用:focus伪类。IE8可能会尊重它不尊重的地方:active。
https://stackoverflow.com/questions/2803808
复制相似问题