Hello, I am trying to learn css and I am learning animations. I am finding that when the animation is applied it moves to the top of the page and I can't understand why or make it move.
If you remove the "1s" from the .spinning cleass - so that it isnt spinning, it moves to the desired location - the center of the page.
If you remove the "1s" from the .spinning cleass - so that it isnt spinning, it moves to the desired location - the center of the page.
HTML:
<div class="spinning">
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 1.0;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 1.4;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 1.8;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 2.2;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 2.6;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 3.0;"></img>
<img class="abcenter vectorColor" src="https://siliqua.buzz/static/images/shell.svg" style="scale: 3.4;"></img>
</div>
CSS:
.abcenter {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform-origin: 0 0;
z-index: -5;
}
.spinning {
animation: spin 1s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
.vectorColor {
filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(186deg) brightness(118%) contrast(119%);
}