人生与戏

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

(2018/12/21  0:21 使用推荐插入代码功能报错)
效果图:

HTML代码:

<div class="circle"></div>

CSS代码:

html,
body,
.circle{
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.circle{
  width: 10em;
  height: 10em;
  background-color: blue;
  border-radius: 50%;
}
.circle:before{
  content: '';
  width: 90%;
  height: 90%;
  border-radius: 50%;
  border-width: 0.1em;
  border-style: solid;
  border-top-color: cyan;
  border-right-color: cyan;
  border-bottom-color: transparent;
  border-left-color: transparent;
  /* 名称 周期 动画从头到尾的速度是相同的 次数 动画应该正常播放 */
  animation: animate 2s linear infinite normal;
}
@keyframes animate {
  from{
    transform: rotate(0deg);
  }
  to{
    transform: rotate(1440deg);
  }
}

  

posted on 2018-12-21 00:23  人生与戏  阅读(162)  评论(0编辑  收藏  举报