css制作春季踏青
使用CSS制作春季踏青主题效果
背景设计 通过渐变和自然元素营造春季氛围,使用柔和的绿色和粉色作为主色调。
body {
background: linear-gradient(135deg, #a8e6cf, #dcedc1, #ffd3b6);
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
}
动画元素 添加飘落的花瓣和蝴蝶动画效果增强春日气息
.petal {
position: absolute;
background: #ffb6c1;
width: 10px;
height: 10px;
border-radius: 50% 0 50% 50%;
animation: fall 8s linear infinite;
}
@keyframes fall {
0% { transform: translateY(-10vh) rotate(0deg); }
100% { transform: translateY(100vh) rotate(360deg); }
}
按钮样式 设计清新的踏青活动按钮
.spring-btn {
background: #77dd77;
border: none;
padding: 12px 24px;
color: white;
border-radius: 25px;
font-size: 16px;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: all 0.3s ease;
}
.spring-btn:hover {
background: #5cb85c;
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
卡片设计 创建踏青地点推荐卡片
.spring-card {
background: rgba(255,255,255,0.8);
border-radius: 15px;
padding: 20px;
margin: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
transition: transform 0.3s ease;
}
.spring-card:hover {
transform: scale(1.03);
}
.spring-card h3 {
color: #2e8b57;
border-bottom: 1px dashed #98fb98;
padding-bottom: 10px;
}
响应式布局 确保在不同设备上都能良好展示
@media (max-width: 768px) {
.spring-card {
width: 90%;
margin: 10px auto;
}
body {
background: linear-gradient(to bottom, #a8e6cf, #dcedc1);
}
}






