首页 > Web开发 > 详细

CSS-是谁的心啊

时间:2021-04-11 21:28:26      阅读:18      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   <style>
      .heart{
          width: 200px;
          height: 200px;
          background: #e74c3c;
          transform: rotate(45deg) scale(0.5);
          animation-name: hd;
          animation-duration: 2s;
          animation-iteration-count: infinite;
      } 
      .heart::before{
        content: ‘‘;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        position: absolute;
        background: #e74c3c;
        transform: translateX(-100px) ;
      }
      @keyframes hd {
          25%{
              transform: rotate(45deg) scale(1);
          }
         50%{
              transform: rotate(45deg) scale(.5);
          }
          75%{
              transform: rotate(45deg) scale(1);
          }
          100%{
              transform: rotate(45deg) scale(.5);
          }
      }
      .heart::after{
        content: ‘‘;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        position: absolute;
        background: #e74c3c;
        transform: translateY(-100px);
      }
      body{
        width: 100vw;
        height: 100vh;
        background: #34495e;
        display: flex;
        justify-content: center;
        align-items: center;
      }
   </style>
</head>
<body>

  <div class="heart"></div>


    <script src="./index.js"></script>
</body>
</html>

CSS-是谁的心啊

原文:https://www.cnblogs.com/lceihen/p/14643825.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!