I want to keep the text inside of the children absolutely positioned in the spinning div. So that the text is in the middle all the time. I didn\'t come across a solution, but I
I think that you shouldn't use parent/child relationship. Just let them be siblings inside a container (I kept the class names just for showing the difference):
<div class="container">
<div class="parent"></div>
<div class="child">This is child</div>
</div>
CSS
@-webkit-keyframes rotate {
from{ -webkit-transform: rotate(0deg); }
to{ -webkit-transform: rotate(360deg); }
}
.parent {
width: 100px;
height: 100px;
border-radius: 50%;
background: #000;
position: relative;
top: 25%;
border: 10px dashed red;
-webkit-animation: rotate 12s linear infinite;
}
.container{
position: relative;
}
.child {
position: absolute;
top: 50px;
left: 20px;
color: #fff;
-webkit-animation: none !important;
}
Here is an updated JSFiddle