简单100行代码一页完成(表白代码-爱心跳动)

一、图片预览效果

 

二、开打你喜欢的编译工具,甚至文本工具都可以只需要完成后把文件格式改成html格式。

<!DOCTYPE html>
<html>

<head>

    <title>跳动爱心</title>

    <meta charset="UTF-8">
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        #background {
            position: relative;
            width: 520px;
            height: 500px;
            background: pink;
            margin: 90px auto;
        }

        .love {
            width: 300px;
            height: 300px;
            background: #d5083b;
            box-shadow: 0px 0px 40px -4px #d5083b;
        }

        .love-left {
            position: absolute;
            top: 0px;
            left: 0px;
            border-radius: 150px;
            /*渐变色 渐变开始位置、渐变开始颜色、渐变结束颜色*/
            background: linear-gradient(to left right, #ee0a44 0%, #d5083b 40%);
            /*box-shadow:-15px -13px 40px -4px #d5083b;*/
            /*box-shadow:0px 0px 40px -4px #d5083b;*/
            /*background:red;*/
            transform: scale(1);
            animation: heart-beat 0.6s ease infinite;
            z-index: 3;
        }

        .love-right {
            position: absolute;
            top: 0px;
            right: 0px;
            border-radius: 150px;
            background: linear-gradient(to right left, #ee0a44 0%, #d5083b 50%);
            /*background:red;*/
            transform: scale(1);
            animation: heart-beat 0.6s ease infinite;
            z-index: 2;
        }

        .love-bottom {
            position: absolute;
            top: 109px;
            left: 110px;
            transform: rotate(45deg) scale(1);
            background: linear-gradient(to left top, #ee0a44 0%, #d5083b 40%);
            /*background:red;*/
            animation: heart-beat 0.6s ease infinite;
            z-index: 1;
        }

        @keyframes heart-beat {
            0% {
                transform: rotate(45deg) scale(1);
                box-shadow: 0px 0px 40px -4px #d5083b;
            }

            50% {
                transform: rotate(45deg) scale(1.1);
                box-shadow: 5px 5px 40px 10px #d5083b;
            }

            100% {
                transform: rotate(45deg) scale(1);
                box-shadow: 0px 0px 40px -4px #d5083b;
            }
        }
    </style>
</head>

<body style=" background: pink">
    <div id="background">
        <div class="love love-left"></div>

        <div class="love love-right"></div>

        <div class="love love-bottom"></div>

    </div>

</body>
</html>

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值