svg+css实现10款不同风格的流程图代码
代码语言:html
所属分类:图表
代码描述:svg+css实现10款不同风格的流程图代码
代码标签: svg css 10款 不同 风格 流程图 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>10款大气好看的HTML流程图合集</title>
<style>
/* 全局基础样式 */
:root {
--primary: #4f46e5;
--secondary: #ec4899;
--bg-color: #f3f4f6;
--text-color: #1f2937;
}
body {
font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 20px;
}
h1 { text-align: center; margin-bottom: 40px; color: #333; }
h2 { margin-bottom: 15px; color: #555; border-bottom: 2px solid #ddd; padding-bottom: 10px; }
/* 容器样式,用于分隔不同案例 */
.demo-container {
background: #fff;
padding: 30px;
margin-bottom: 50px;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
overflow-x: auto;
}
/* =========================================
1. 现代渐变箭头式 (CSS Clip-path)
========================================= */
.flow-1 {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.flow-1-step {
position: relative;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 15px 30px 15px 40px;
clip-path: polygon(90% 0, 100% 50%, 90% 100%, 0% 100%, 10% 50%, 0% 0%);
font-weight: bold;
transition: transform 0.3s;
cursor: pointer;
min-width: 120px;
text-align: center;
}
.flow-1-step:first-child {
clip-path: polygon(90% 0, 100% 50%, 90% 100%, 0% 100%, 0% 0%);
padding-left: 20px;
}
.flow-1-step:last-child {
clip-path: polygon(100% 0, 100% 100%, 0% 100%, 10% 50%, 0% 0%);
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
color: #005c4b;
}
.flow-1-step:hover {
transform: scale(1.05);
z-index: 10;
filter: brightness(1.1);
}
/* =========================================
2. 垂直时间轴式 (Timeline)
========================================= */
.flow-2 {
position: relative;
max-width: 600px;
margin: 0 auto;
}
.flow-2::after {
content: '';
position: absolute;
width: 4px;
background-color: #e5e7eb;
top: 0;
bottom: 0;
left: 50%;
margin-left: -2px;
}
.flow-2-item {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
box-sizing: border-box;
}
.flow-2-item::after {
content: '';
position: absolute;
width: 20px;
height: 20px;
right: -10px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
border-radius: 50%;
z-index: 1;
}
.flow-2-left { left: 0; text-align: right; }
.flow-2-right { left: 50%; }
.flow-2-right::after { left: -10px; }
.flow-2-content {
padding: 20px;
background-color: white;
border-radius: 6px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
border-left: 4px solid #FF9F55;
}
.flow-2-right .flow-2-content { border-left: non.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0