<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./index.css">
</head>
<body>
<div class="container">
<span>十年后,你会发现css才是你永远也学不会的语言。</span>
</div>
</body>
</html>
.container {
width: 200px;
font-size: 30px;
}
.container span {
background: linear-gradient(to right, #ec695c, #61c454) no-repeat right bottom;
background-size: 0 3px;
transition: background-size 1300ms;
}
.container span:hover {
background-position-x: left;
background-size: 100% 3px;
}
划入文件渐变色