I have created a CSS3 animation on a button. At the moment, it works perfectly everywhere apart from IE. I know it wont work well in older IE versions, but I was atleast expecting it to work in IE11.
I have created a fiddle to demonstrate Fiddle
I call the animation on :before
and :after
like so
animation: 1000ms ease 0s normal none infinite running pulse-long;
If you open the fiddle in Firefox or Chrome, you should see the animation on the button working. If you open it in IE11, it is just a static dot. I have gone online and tried a few things, such as moving the animation frames to the top of the CSS file, but it still does not work.
Is there any way to get this animation working in IE11?
There are two things that are preventing the animation from working in IE11 and they are as follows:
animation-play-state
asrunning
in the shorthand. There is no justification for this and it should probably be considered as a bug. Fix for this issue should be to just remove therunning
from the shorthand. This will cause no harm because the default value foranimation-play-state
isrunning
.overflow: visible
for the button container (.btnPulse.inactive
). This will also not cause any problem in other browser because they are anyway doing this by default.Snippet showing the overflow problem:
In the below snippet, I have avoided the animations and just added a couple of default
box-shadow
to the pseudo-elements such that the whole thing looks like 4 concentric circles with a red colored circle (produced by the button element) in the middle, followed by a white circle (blank space), followed by a blue colored circle (produced by box shadow of:before
element) and then a green circle (produced by box shadow of:after
element).In Chrome, Firefox and Opera the concentric circles would be visible completely but IE11 will show only the center red circle because the rest is outside parent's area.
Working Snippet with the fix:
The below snippet has both the above mentioned fixes applied and it works in IE11, Chrome, Firefox and Opera.