-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclip实现hover文字填充效果.html
40 lines (40 loc) · 1013 Bytes
/
clip实现hover文字填充效果.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>clip实现hover文字填充效果</title>
<style>
body {
display: flex;
height: 100vh;
justify-content: center;
align-items: center;
text-align: center;
background: #1a1e23;
}
a {
display: block;
padding: 4px 0;
font-size: 100px;
text-decoration: none;
text-transform: uppercase;
-webkit-text-stroke: 2px #198ce6;
background: linear-gradient(#198ce6 0 100%) left/0 no-repeat;
color: transparent;
-webkit-background-clip: text;
background-clip: text;
transition: 0.5s linear;
}
a:hover {
background-size: 100%;
}
</style>
</head>
<body>
<div>
<a href="#">home</a>
</div>
</body>
</html>