【发布时间】:2021-11-19 17:15:21
【问题描述】:
我在一个旋转的圆圈虚线边框之后。 这是我目前所拥有的:
/*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>
我担心的是这两个点的间距不均匀。我想这是边界的尽头实际交汇的地方。有点难以注意到,所以我附上截图:
有没有更好的方法来编写这个代码?我想要一个没有这两个近点的圆圈。
非常感谢!
【问题讨论】:
-
由于点是由浏览器自动呈现的,因此您无能为力。尝试使用边框 5px。
-
谢谢,很遗憾,边框宽度不能解决问题,不管边框多粗,问题依旧。
-
这不是什么大问题。我会忘记的。
标签: css animation border dotted-line