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>
相关推荐
心之语歌11 分钟前
flutter 父子组件互相调用方法,值更新
前端·javascript·flutter
岱宗夫up34 分钟前
FastAPI进阶3:云原生架构与DevOps最佳实践
前端·python·云原生·架构·前端框架·fastapi·devops
赛博切图仔35 分钟前
告别“打字机”:Generative UI 如何重塑 AI 时代的前端交互?
前端·人工智能·ui
wangbing112537 分钟前
开发指南141-类和字节数组转换
java·服务器·前端
~央千澈~38 分钟前
抖音弹幕游戏开发之第15集:添加配置文件·优雅草云桧·卓伊凡
java·前端·python
wsad053241 分钟前
Shell 脚本中的多行注释和 Here Document 语法解析
前端·chrome
肖。35487870941 小时前
html中onclick误区,后续变量会更改怎么办?
android·java·javascript·css·html
用户5757303346241 小时前
🎨 CSS变量彻底指南:从入门到精通,99%的人不知道的动态样式魔法!
css
用户5757303346241 小时前
🎯 CSS 定位详解:从入门到面试通关
css
J2虾虾1 小时前
Vite前端项目构建
前端