css+svg实现多样化文字效果代码
代码语言:html
所属分类:布局界面
代码描述:css+svg实现多样化文字效果代码
下面为部分代码预览,完整代码请点击下载或在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>SVG + CSS 文字特效展示</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
color: #fff;
min-height: 100vh;
padding: 20px;
overflow-x: hidden;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 40px;
padding: 20px;
position: relative;
}
h1 {
font-size: 3.5rem;
margin-bottom: 15px;
background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #556270);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
position: relative;
display: inline-block;
}
.subtitle {
font-size: 1.2rem;
max-width: 700px;
margin: 0 auto;
line-height: 1.6;
color: #e0e0ff;
}
.effects-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
margin-top: 40px;
}
.effect-card {
background: rgba(25, 25, 50, 0.7);
border-radius: 15px;
padding: 25px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
align-items: center;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
min-height: 250px;
}
.effect-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}
.effect-title {
font-size: 1.2rem;
margin-bottom: 20px;
text-align: center;
color: #4ecdc4;
}
.effect-display {
width: 100%;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
}
.effect-display svg {
max-width: 100%;
max-height: 100%;
}
.effect-description {
margin-top: 15px;
font-size: 0.9rem;
text-align: center;
color: #a0a0d0;
}
/* 特效1: 渐变文字 */
.gradient-text {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0