html css实现爱心

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
          /* 爱心 */
          .love {
            position: relative;
            top: 100px;
            left: 100px;
            width: 60px;
            height: 60px;
            background-color: tomato;
            transform: rotate(-45deg);
        }
        .love:before {
            content: "";
            position: absolute;
            top: -30px;
            left: 0;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: tomato;
        }
        
        .love:after {
            content: "";
            position: absolute;
            top: 0px;
            left: 30px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: tomato;
        }
    </style>
</head>
<body>
    <div class="love"></div>
</body>
</html>
相关推荐
05Nuyoah1 小时前
CSS文本和字体属性,列表属性
javascript·css·css3
忆往wu前1 小时前
前端请求三部曲:Ajax / Fetch / Axios 演进与 Vue 工程化封装
前端·vue.js
GGBond今天继续上班2 小时前
只需要一条命令,让所有 AI 应用工具共享 skills
前端·人工智能·开源
Hilaku2 小时前
为什么我不建议普通前端盲目卷全栈?
前端·javascript·程序员
啃玉米的艺术家2 小时前
监控项目------(boa移植问题)
前端·chrome
哀木2 小时前
手搓你的 AI 外置记忆,连接飞书体验直接脚踢龙虾
前端·ai编程
董董灿是个攻城狮2 小时前
荣耀一个做手机的,凭啥机器人夺冠?
前端
CDN3602 小时前
【前端进阶】告别“慢”与“不安全”:我是如何用360CDN搞定API加速和HTTPS的
前端·安全·https
Rabbit码工2 小时前
HTML5 与 CSS3 新特性全解析:从结构优化到视觉升级
前端·css·css3·html5
王美丽1.852 小时前
css3选择器
前端·css·css3