Internet Explorer button:active inner-padding

2019-03-17 13:20发布

Trident <=9 seems to append something like an inner-padding to active elements.

Is it possible to disable this feature by using css ?

note: this is just a example, not a real world screenshot

3条回答
Viruses.
2楼-- · 2019-03-17 14:01

In Microsoft Internet Explorer 11+ you can fix it! Use position: relative for inner elements of button.

html:

<button><span>Submit</span></button>

css:

button > span{position:relative}

Enjoy!

查看更多
手持菜刀,她持情操
3楼-- · 2019-03-17 14:03

Update: For IE11+, it can be removed.


No, you can't get rid of it (in old versions of Internet Explorer).

As @Spudley said:

If you don't want that effect, don't use a button element.

If it really matters, then an a element is the only alternative, but it's not really worth switching just to fix this. Users of Internet Explorer are used to it.

查看更多
女痞
4楼-- · 2019-03-17 14:08
<button><span>Submit</span></button>

button:active > span {
 -ms-transform: translate(0px, -0.5px);
}
查看更多
登录 后发表回答