【CSS】渐变下划线

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1.0"
  >
  <title>Document</title>
  <style>
    .title {
     
      color: #333;
      line-height: 2;
    }
    .title span {
     
      background: linear-gradient(to right, #ec659c, #61c454) no-repeat right bottom;
      background-size: 0 2px;
      transition: background-size 1s;
    }
    .title span:hover {
     
      background-position-x: left;
      background-size: 100% 2px;
      cursor: pointer;
    }
  </style>
</head>

<body>
  <h2 class="title">
    <span>渐变下划线效果展示</span>
  </h2>
</body>

</html>

在这里插入图片描述

相关推荐

  1. css 边框渐变

    2024-01-09 12:14:02       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-09 12:14:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-09 12:14:02       18 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-09 12:14:02       17 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-09 12:14:02       20 阅读

热门阅读

  1. 华纳云:Ubuntu上如何增加Swap分区?

    2024-01-09 12:14:02       35 阅读
  2. 连接oracle报:ora-28001:the password has expired

    2024-01-09 12:14:02       29 阅读
  3. leetcode每日一题43

    2024-01-09 12:14:02       39 阅读
  4. LeetCode——447. 回旋镖的数量

    2024-01-09 12:14:02       35 阅读
  5. LeetCode 每日一题 2024/1/1-2024/1/7

    2024-01-09 12:14:02       36 阅读