CSS3 animation not working in safari
Found the solution. In Safari when you use Keyframes you need to use the whole percentage:
this won't work:
@-webkit-keyframes keyarm {
0% { -webkit-transform: rotate(0deg); }
5% { -webkit-transform: rotate(-14deg); }
10% { -webkit-transform: rotate(0deg); }
}
this will:
@-webkit-keyframes keyarm {
0% { -webkit-transform: rotate(0deg); }
5% { -webkit-transform: rotate(-14deg); }
10% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(0deg); }
}
Don't know why but that's the way Safari works! :)
CSS Animation does only work in Firefox and Chrome, but not on Apple Devices (Safari?)
Use webkits
for your keyframes:
@-webkit-keyframes counter {
0% { -webkit-counter-increment: count 0; }
10% { -webkit-counter-increment: count 8; }
20% { -webkit-counter-increment: count 16; }
30% { -webkit-counter-increment: count 32; }
40% { -webkit-counter-increment: count 64; }
50% { -webkit-counter-increment: count 128; }
60% { -webkit-counter-increment: count 256; }
70% { -webkit-counter-increment: count 512; }
80% { -webkit-counter-increment: count 1024; }
90% { -webkit-counter-increment: count 2048; }
100% { -webkit-counter-increment: count 4000; }
}
@keyframes counter {
0% { counter-increment: count 0; }
10% { counter-increment: count 8; }
20% { counter-increment: count 16; }
30% { counter-increment: count 32; }
40% { counter-increment: count 64; }
50% { counter-increment: count 128; }
60% { counter-increment: count 256; }
70% { counter-increment: count 512; }
80% { counter-increment: count 1024; }
90% { counter-increment: count 2048; }
100% { counter-increment: count 4000; }
}
div::after {
font: 800 40px system-ui;
content: counter(count);
animation: counter 5s linear forwards;
counter-reset: count 0;
}
<div></div>
CSS Animation working on Chrome but not on Safari
It's because you're not setting the full range on the transform percentage. Safari requires that you specify the 100% endpoint. See this related answer: CSS3 animation not working in safari
css3 animation not working in chrome
You have to put the general animation rule after the browser specific ones:
-webkit-animation: aia2 5s linear infinite alternate;
-moz-animation: aia2 5s linear infinite alternate;
-ms-animation: aia2 5s linear infinite alternate;
-o-animation: aia2 5s linear infinite alternate;
animation: aia2 5s linear infinite alternate; /* this comes last */
And since you have -webkit-animation: aia2
, -moz-animation: aia2
etc. you have to set the animation for each browser like:
@-moz-keyframes aia2{
...
}
@-webkit-keyframes aia2{
...
}
@-o-keyframes aia2{
...
}
Related Topics
How to Use Tick/Checkmark Symbol (✓) Instead of Bullets in Unordered List
How to Use CSS to Reverse The Display Order of Two Elements
Div Height:100%; Not Working with Display:Table-Cell;
Flying-Saucer/Itext PDF in Servlet Not Finding CSS File
Aligning Text and Select Boxes to The Same Width in CSS
How to Have 2 Floating Divs Have The Same Height
A Singleton List of List Is Automatically Decomposed
Iframe Z-Index for Drop Down Menu
Adding Dynamic Class Name in Svelte
How to Make The Scrollbar on a Div Only Visible When Necessary
Why Doesn't The Wrapper Div Wrap The One and Two Divs? (In Firefox Browser)
How to Style Contenteditable in Firefox
Will Whitespace or Wrap Be Ignored Between Two Block Elements in HTML
Supporting Multiple Resolution and Density of Images in Phonegap
Simple Two Column HTML Layout Without Using Tables
Equal Height Divs (Two Column)