我在一个旋转的圆圈虚线边框之后。这是我到目前为止所拥有的:
/*Stylings*/
.square {
width: 70px;
height: 61px;
background: red;
}
.button-border {
width: 100%;
height: 100%;
border-radius: 50%;
border: 4px dotted #6B8291;
-webkit-animation-name: Rotate;
-webkit-animation-duration: 20s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: Rotate;
-moz-animation-duration: 20s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: Rotate;
-ms-animation-duration: 20s;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
}
.button-container {
position: relative;
width: 138px;
height: 138px;
}
.img_rotating .square {
position: absolute;
top: 50%;
left: 50%!important;
transform: translate(-50%,-50%);
}
/*Animation*/
@-webkit-keyframes Rotate
{
from{-webkit-transform:rotate(0deg);}
to{-webkit-transform:rotate(360deg);}
}
@-moz-keyframes Rotate
{
from{-moz-transform:rotate(0deg);}
to{-moz-transform:rotate(360deg);}
}
<div class="img_rotating">
<div class="button-container">
<div class="square"></div>
<div class="button-border"></div>
</div>
</div>
我担心的是这两个间距不均匀的点。我想这是边界的尽头实际交汇的地方。有点难以注意到,所以我发送了一个截图:
有没有更好的方法来编码这个?我想要一个没有这两个近点的圆圈。
非常感谢!