生日快乐html动态网页
时间: 2023-12-05 22:40:50 浏览: 39
以下是一个简单的生日快乐HTML动态网页的例子:
```html
<!DOCTYPE html>
<html>
<head>
<title>生日快乐</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
text-align: center;
}
h1 {
color: #ff69b4;
font-size: 60px;
margin-top: 100px; }
img {
border-radius: 50%;
margin-top: 50px;
box-shadow: 5px 5px 10px #888888;
}
#cake {
position: relative;
margin-top: 50px;
width: 300px;
height: 300px;
animation: rotate 5s linear infinite;
}
#candle {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 20px;
height: 50px;
background-color: #ff69b4;
border-radius: 10px 10px 0 0;
box-shadow: 0 0 5px #888888;
animation: flicker 0.5s linear infinite alternate;
}
#flame {
position: absolute;
top: -30px;
left: 50%;
transform: translateX(-50%);
width: 10px;
height: 30px;
background-color: #ffdb58;
border-radius: 50%;
box-shadow: 0 0 5px #ffdb58, 0 0 10px #ffdb58, 0 0 15px #ffdb58, 0 0 20px #ffdb58, 0 0 25px #ffdb58;
animation: flicker 0.5s linear infinite alternate-reverse;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes flicker {
from {
opacity: 1;
}
to {
opacity: 0.5;
}
}
</style>
</head>
<body>
<h1>生日快乐!</h1>
<img src="https://picsum.photos/200" alt="birthday girl/boy">
<div id="cake">
<div id="candle">
<div id="flame"></div>
</div>
</div>
<script>
alert("祝你生日快乐!");
</script>
</body>
</html>
```
该网页包括一个标题、一张图片、一个旋转的蛋糕和一个闪烁的蜡烛。当用户打开网页时,会弹出一个祝福框。