アニメーションの開始時に正方形を中央にmargin-left:-3.5vh;
配置し、キーフレーム アニメーションで 0 にアニメーション化できます。
デモ
CSS :
#outer{
background: orange;
height: 7vh;
width: 100%;
}
#logo{
height: 7vh;
position: absolute;
left: 50%;
margin-left:-3.5vh;
width: 7vh;
-webkit-animation: moveLeft 1s forwards ease-in-out;
-moz-animation: moveLeft 1s forwards ease-in-out;
-ms-animation: moveLeft 1s forwards ease-in-out;
-o-animation: moveLeft 1s forwards ease-in-out;
animation: moveLeft 1s forwards ease-in-out;
background: black;
}
@-webkit-keyframes moveLeft {
from {left: 50%;margin-left:-3.5vh;}
to {left: 0;margin-left:0; -webkit-transform: rotate(360deg);}
}
@-o-keyframes moveLeft {
from {left: 50%;margin-left:-3.5vh;}
to {left: 0;margin-left:0; -webkit-transform: rotate(360deg);}
}
@-moz-keyframes moveLeft {
from {left: 50%;margin-left:-3.5vh;}
to {left: 0;margin-left:0; -webkit-transform: rotate(360deg);}
}
@keyframes moveLeft {
from {left: 50%;margin-left:-3.5vh;}
to {left: 0;margin-left:0; -webkit-transform: rotate(360deg);}
}