svg+css实现多样化文字效果代码

代码语言:html

所属分类:布局界面

代码描述:svg+css实现多样化文字效果代码

代码标签: 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">
  <title>SVG + CSS 文字效果合集</title>
  <style>
    body {
      background: #1a1a1a;
      color: white;
      font-family: 'Segoe UI', sans-serif;
      padding: 20px;
      display: flex;
      flex-wrap: wrap;
      gap: 30px;
    }

    .example {
      background: #2a2a2a;
      padding: 20px;
      border-radius: 10px;
      width: calc(33% - 20px);
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    svg {
      max-width: 100%;
      height: auto;
    }

    h3 {
      margin-top: 10px;
      font-size: 16px;
      color: #ccc;
    }

    @media (max-width: 900px) {
      .example {
        width: calc(50% - 20px);
      }
    }

    @media (max-width: 600px) {
      .example {
        width: 100%;
      }
    }
  </style>
</head>
<body>

  <h1 style="text-align: center; width: 100%; margin-bottom: 40px;">SVG + CSS 文字效果合集</h1>

  <!-- 示例 1:渐变填充 -->
  <div class="example">
    <svg width="200" height="80".........完整代码请登录后点击上方下载按钮下载查看

网友评论0