用html写一个爱心树
时间: 2023-09-30 20:06:26 浏览: 54
好的,以下是一个简单的HTML爱心树代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>爱心树</title>
</head>
<body>
<svg width="400" height="400">
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:#ed1c24;stop-opacity:1" />
<stop offset="100%" style="stop-color:#ffae00;stop-opacity:1" />
</linearGradient>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="url(#grad1)" />
<path fill="#fff" d="M218.1,246.6L125,339.7c-7.4,7.5-19.4,7.5-26.8,0l-92-92.9c-7.4-7.5-7.4-19.7,0-27.2l12.5-12.6
c7.4-7.5,19.4-7.5,26.8,0l53.2,53.7l53.2-53.7c7.4-7.5,19.4-7.5,26.8,0l12.5,12.6C225.5,226.9,225.5,239.1,218.1,246.6z" />
<text x="50%" y="50%" fill="#ffffff" font-size="50" font-family="Arial" dy=".3em" text-anchor="middle">爱❤️你</text>
</svg>
</body>
</html>
```
希望我的回答对您有所帮助!