<!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>
09-05
341
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-10
798
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-05
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交