我无法删除Internet Explorer 9中按钮的按下效果 [英] I can't remove the pressed effect of buttons in Internet Explorer 9
问题描述
我正在尝试从IE9上的按钮中删除按下的效果。在所有其他浏览器中我没有问题。
I'm trying to remove the pressed effect from button on IE9. In all other browsers I have no problems.
请查看代码
HTML
<button class="fancy">howdy!</button>
CSS
.fancy {
width: 60px;
height: 30px;
position: relative;
top: 0px;
margin: 0;
padding: 0px;
display: block;
border: none;
padding: 0;
color: #FFF;
font-size: 11px;
background: green;
outline: none;
overflow: hidden;
line-height: 11px;
}
.fancy:active,.fancy:focus
{
padding:0px;
margin:0px;
border: none;
outline:none;
text-indent: 0;
line-height: 11px;
}
工作演示 http://jsfiddle.net/MDfvE/
正如您所看到的,当您单击IE9上的按钮时将看到文本被移动到右侧和底部。我想删除它。
As you can see, when you click the button on IE9 you will see that the text is moved to the right and bottom. I want to remove that.
任何线索?谢谢!
推荐答案
当元素是锚时,IE只识别:active伪类。
IE only recognizes the :active pseudo class when the element is an anchor.
http:/ /msdn.microsoft.com/en-us/library/cc848864%28v=VS.85%29.aspx
尝试将按钮元素更改为锚标记并调整样式以重新创建按钮的外观。
Try changing the button element to an anchor tag and adjust the styling to recreate the look you had for your button.
这篇关于我无法删除Internet Explorer 9中按钮的按下效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!