Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer button:active inner-padding

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

Is it possible to disable this feature by using css ?

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

like image 726
mate64 Avatar asked Jul 19 '11 08:07

mate64


3 Answers

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!

like image 106
Максим К. Avatar answered Sep 22 '22 06:09

Максим К.


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.

like image 38
thirtydot Avatar answered Sep 24 '22 06:09

thirtydot


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

button:active > span {
 -ms-transform: translate(0px, -0.5px);
}
like image 44
wilsonpage Avatar answered Sep 24 '22 06:09

wilsonpage