2 个回答

加个旋转的伪类

.container {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: whitesmoke;
}
.container::after {
    content: '';
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: block;
    position: absolute;
    border-width: 2px;
    border-radius: 100%;
    border-style: solid;
    border-top-color: transparent;
    border-right-color: transparent;
    animation-name: trun;
    animation-duration: 1s;
    animation-iteration-count: infinite;
}
@keyframes trun {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题