# 彼岸花HTML代码 以下是一个展示彼岸花效果的HTML代码,包含简单的CSS动画效果: ```html <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>彼岸花效果</title> <style> body { background-color: #000; display: flex; justify-content: center; align-items: center; height: 100vh; overflow: hidden; } .flower { position: relative; width: 200px; height: 200px; } .petal { position: absolute; width: 60px; height: 120px; background: linear-gradient(to bottom, #ff3366, #cc0033); border-radius: 30px 30px 0 0; transform-origin: bottom center; box-shadow: 0 0 15px #ff0033; } .stamen { position: absolute; width: 20px; height: 60px; background: linear-gradient(to bottom, #ffcc00, #ff6600); border-radius: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 10px #ffcc00; } .stem { position: absolute; width: 8px; height: 300px; background: linear-gradient(to bottom, #009933, #006622); top: 100%; left: 50%; transform: translateX(-50%); } @keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } } .flower { animation: sway 3s ease-in-out infinite; } </style> </head> <body> <div class="flower"> <!-- 花瓣 --> <div class="petal" style="transform: rotate(0deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(30deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(60deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(90deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(120deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(150deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(180deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(210deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(240deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(270deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(300deg) translateY(-40px);"></div> <div class="petal" style="transform: rotate(330deg) translateY(-40px);"></div> <!-- 花蕊 --> <div class="stamen"></div> <!-- 花茎 --> <div class="stem"></div> </div> </body> </html> ``` 这段代码创建了一个简单的彼岸花动画效果,包含以下元素: - 12片红色渐变花瓣 - 黄色渐变花蕊 - 绿色渐变花茎 - 轻微的摇摆动画 1. 花瓣数量可以调整,彼岸花通常有4-7片花瓣,这里用了12片是为了视觉效果 2. 颜色可以根据需要调整,彼岸花通常是鲜红色 3. 动画效果可以修改为更复杂的形态变化 [2025-05-14 16:39:03 | AI写代码神器 | 910点数解答]