<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>步骤卡片设计HTML示例2</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
padding: 2rem;
background-color: #f0f0f3;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2rem;
color: #333;
}
.steps-container {
display: flex;
gap: 20px;
position: relative;
flex-wrap: wrap;
}
.step-card {
flex: 1;
min-width: 120px;
max-width: 220px;
padding: 20px;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
border-radius: 10px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.step-card:nth-child(1) {
background-color: #ffd700;
}
.step-card:nth-child(2) {
background-color: #ff8c00;
}
.step-card:nth-child(3) {
background-color: #e91e63;
}
.step-card:nth-child(4) {
background-color: #9c27b0;
}
.step-card:nth-child(5) {
background-color: #00bcd4;
}
.circle {
width: 90px;
height: 90px;
background-color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.number {
font-size: 2rem;
font-weight: bold;
}
.step-card:nth-child(1) .number {
color: #ffd700;
}
.step-card:nth-child(2) .number {
color: #ff8c00;
}
.step-card:nth-child(3) .number {
color: #e91e63;
}
.step-card:nth-child(4) .number {
color: #9c27b0;
}
.step-card:nth-child(5) .number {
color: #00bcd4;
}
.step-title {
font-size: 1.3rem;
font-weight: bold;
margin-bottom: 1rem;
text-align: center;
color: #fff;
}
.step-content {
text-align: center;
line-height: 1.5;
color: #333;
font-size: 0.9rem;
padding: 0 10px;
}
@media (max-width: 1200px) {
.steps-container {
justify-content: center;
}
.step-card {
margin-bottom: 1rem;
}
}
</style>
</head>
<body>
<div class="container">
<h1 class="title">步骤卡片设计示例</h1>
<div class="steps-container">
<div class="step-card">
<div class="circle">
<span class="number">01</span>
</div>
<h3 class="step-title">FIRST OPTION
</h3>
<p class="step-content">这是第一个步骤的详细说明,包含了该步骤的主要内容和需要注意的关键点。</p>
</div>
<div class="step-card">
<div class="circle">
<span class="number">02</span>
</div>
<h3 class="step-title">SECOND OPTION
</h3>
<p class="step-content">第二个步骤的具体说明,解释了这一环节需要完成的任务和实施方法。</p>
</div>
<div class="step-card">
<div class="circle">
<span class="number">03</span>
</div>
<h3 class="step-title">THIRD OPTION
</h3>
<p class="step-content">在第三步中,我们将详细说明这个环节的操作流程和应该达到的预期效果。</p>
</div>
<div class="step-card">
<div class="circle">
<span class="number">04</span>
</div>
<h3 class="step-title">FOURTH OPTION
</h3>
<p class="step-content">第四个步骤包含了重要的执行细节,确保流程能够顺利进行并达到预定目标。</p>
</div>
<div class="step-card">
<div class="circle">
<span class="number">05</span>
</div>
<h3 class="step-title">FIFTH OPTION
</h3>
<p class="step-content">最后一步是总结和完善阶段,确保所有前序步骤都已完成并达到预期效果。</p>
</div>
</div>
</div>
</body>
</html>
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ... </head>
<body>
</body>
控制台