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>
相关推荐
子醉29 分钟前
推荐一种适合前端开发使用的解决本地跨域问题的办法
前端
Niyy_37 分钟前
前端一个工程构建多个项目,记录一次工程搭建
前端·javascript
xiangxiongfly9151 小时前
CSS link标签
前端·css
岁月宁静2 小时前
AI 多模态全栈应用项目描述
前端·vue.js·node.js
十年磨一剑~2 小时前
html+js开发一个测试工具
javascript·css·html
爱吃巧克力的程序媛2 小时前
将qt界面中加载css或者qss样式
开发语言·css·qt
nn_(nana)3 小时前
修改文件权限--- chmod ,vi/vim,查看文件内容,yum-软件包管理器,systemctl管理系统服务
前端
汪汪队立大功1233 小时前
JavaScript是怎么和html元素关联起来的?
开发语言·javascript·html
烛阴4 小时前
从零开始掌握C#核心:变量与数据类型
前端·c#