祝所有码农七夕快乐~

创意代码表白

以程序员的方式撒狗粮,专业浪漫,值得拥有!


<!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>
 
        
        /* 跳动 */
        @keyframes beat {
                from {
                    transform: rotate(45deg) scale(2);
                }
            
                to {
                    transform: rotate(45deg) scale(2.3);
                }
            }   
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #f7f1e3;
        }
     
        .love {
            width: 100px;
            height: 100px;  
            background-color: #e74c3c;
            transform: rotate(45deg) scale(2);
            animation: beat 800ms ease infinite alternate forwards; 
			position: relative;
          
        }
 
        .score {
            width: 80px;
            height: 80px;  
            background-color: #e74c3c;
            position: absolute;
            top: 10px;
            left: 10px; 
			z-index: 100;
			

        }

		.content {
			transform: rotate(-45deg);
			position: absolute;
			top: 12px;
			left: -19px;
			font-size: 20px;
			
		}
 
        .love,
        .love::before,
        .love::after {
            box-shadow: -5px 16px 12px -3px rgba(0,0,0,0.4) inset;
        }
 
        .love::before, 
        .love::after {
            content: "";
            display: block;
            width: 100px;
            height: 100px;
            background-color: rgba(231, 76, 60,1.0);
            border-radius: 50%;
            position: absolute;
        }
        
        .love::before {
            right: 50%;
        }
        .love::after {
            bottom: 50%;
        }
     
    </style>
</head>
<body>
    <div class="love"><div class="score"><div class="content">七夕快乐~</div></div></div>
</body>
</html>

  • 效果演示

 你是CSS我是DIV,没有你,就算我布局的再好,没了你也失去了颜色


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值