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);
    }
}
推荐问题