HTML小案例-CSS3实现旋转太极图

HTML小案例-CSS3实现旋转太极图

话不多说,先看效果

在这里插入图片描述

** 以下为源代码 **

<!doctype html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>CSS3实现旋转太极图</title>
  <style type="text/css">
    * {margin: 0; padding: 0}
    .circlebox {
      width: 300px;
      height: 300px;
      margin: 200px auto;
      position:relative;
      /* 动画设置为匀速 无限循环*/
      animation: move 3s linear infinite;
    }
    .circleblack {
      width: 300px;
      height: 300px;
      background: black;
      border-radius: 50%;
    }
    .circlewhite {
      width: 150px;
      height: 300px;
      background: pink;
      /* 将此矩形的右上角和右下角去掉 */
      border-top-right-radius: 150px;
      border-bottom-right-radius: 150px;
      position: absolute;
      top: 0;
      right: 0;
    }
    .circlebb {
      width: 150px;
      height: 150px;
      background: black;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: 75px;
    }
    .circleww {
      width: 150px;
      height: 150px;
      background: pink;
      border-radius: 50%;
      position: absolute;
      bottom: 0;
      right: 75px;
    }
    .circlebbl {
      width: 20px;
      height: 20px;
      background: black;
      border-radius: 50%;
      position: absolute;
      bottom: 75px;
      left: 140px;
    }
    .circlewwl {
      width: 20px;
      height: 20px;
      background: pink;
      border-radius: 50%;
      position: absolute;
      top: 75px;
      right: 140px;
    }
    @keyframes move {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
  </style>
</head>
<body>
<div class="circlebox">
  <!--    黑色大圆-->
  <div class="circleblack"></div>
  <!--    粉色半圆-->
  <div class="circlewhite"></div>
  <!--    黑色小圆-->
  <div class="circlebb"></div>
  <!--    粉色小圆-->
  <div class="circleww"></div>
  <!--    黑色小小圆-->
  <div class="circlebbl"></div>
  <!--    粉色小小圆-->
  <div class="circlewwl"></div>
</div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

NCU-wfb

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值