html网页制作生日蛋糕
时间: 2023-11-25 21:51:54 浏览: 95
以下是制作生日蛋糕的HTML代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>生日蛋糕</title>
<style>
body {
background-color: #F5DEB3;
}
.cake {
width: 300px;
height: 400px;
background-color: #F08080;
border-radius: 50% 50% 0 0;
position: relative;
margin: 0 auto;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.cake:before {
content: "";
width: 280px;
height: 380px;
background-color: #FFDAB9;
border-radius: 50% 50% 0 0;
position: absolute;
top: 10px;
left: 10px;
z-index: -1;
}
.candle {
width: 20px;
height: 100px;
background-color: #FFFACD;
position: absolute;
top: -100px;
left: 140px;
border-radius: 10px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}
.flame {
width: 40px;
height: 40px;
background-color: #FFD700;
border-radius: 50%;
position: absolute;
top: -40px;
left: -10px;
box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
animation: flicker 0.5s infinite alternate;
}
@keyframes flicker {
from {
box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}
to {
box-shadow: 0 0 20px rgba(255, 215, 0, 0);
}
}
.plate {
width: 200px;
height: 20px;
background-color: #FFFACD;
position: absolute;
top: 350px;
left: 50px;
border-radius: 10px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}
.plate:before {
content: "";
width: 20px;
height: 20px;
background-color: #FFFACD;
position: absolute;
top: -10px;
left: -10px;
border-radius: 50%;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}
.plate:after {
content: "";
width: 20px;
height: 20px;
background-color: #FFFACD;
position: absolute;
top: -10px;
right: -10px;
border-radius: 50%;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<div class="cake">
<div class="candle">
<div class="flame"></div>
</div>
</div>
<div class="plate"></div>
</body>
</html>
```