<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Candle Effect</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #1a1a1a; } .candle { position: relative; width: 30px; height: 100px; background-color: #fff; border-radius: 5px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); } .flame { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: 15px; height: 30px; background-color: #ffcc00; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: flicker 0.1s infinite alternate; } .flame::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; background-color: #ff6600; border-radius: 50%; opacity: 0.5; } @keyframes flicker { 0% { transform: translateX(-50%) scale(1); } 100% { transform: translateX(-50%) scale(1.1); } } .glow { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 40px; height: 40px; background-color: rgba(255, 204, 0, 0.2); border-radius: 50%; animation: glow 1s infinite alternate; } @keyframes glow { 0% { box-shadow: 0 0 20px 10px rgba(255, 204, 0, 0.2); } 100% { box-shadow: 0 0 30px 15px rgba(255, 204, 0, 0.4); } } </style> </head> <body> <div class="candle"> <div class="flame"></div> <div class="glow"></div> </div> </body> </html>
HTML 会动的蜡烛。
转载请注明出处或者链接地址:https://www.qianduange.cn//article/21246.html
发布的文章
C/C | 每日一练 (2)
2025-02-24 13:02:49
Linux性能监控工具汇总
2025-02-24 13:02:48
在线骑行|基于SpringBoot的在线骑行网站设计与实现(源码 数据库 文档)
2025-02-24 13:02:48
DeepSeek 提示词:定义、作用、分类与设计原则
2025-02-24 13:02:48
【Linux系统】—— 冯诺依曼体系结构与操作系统初理解
2025-02-24 13:02:48
Python常见面试题的详解16
2025-02-24 13:02:48
Docker实战-使用docker compose搭建博客
2025-02-24 13:02:47
QQ登录测试用例报告
2025-02-24 13:02:47
乐享数科:供应链金融—三个不同阶段的融资模式
2025-02-24 13:02:47
【Deepseek】Linux 本地部署 Deepseek
2025-02-24 13:02:47
大家推荐的文章