效果图
HTML部分
<!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="style.css">
</head>
<body>
<h2><span>Visual</span><span>Studio</span><span>Code</span></h2>
</body>
</html>
css部分
* {
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #000000;
}
h2 {
font-size: 6em;
font-weight: 500;
color: #222222;
letter-spacing: 5px;
cursor: pointer;
}
h2 span {
transition: all 0.5s;
}
h2:hover span:nth-child(1) {
margin-right: 40px;
}
h2:hover span:nth-child(3) {
margin-left: 40px;
}
h2:hover span:nth-child(1),
h2:hover span:nth-child(3) {
color: #ffffff;
text-shadow: 0 0 10px #ffffff,
0 0 20px #ffffff,
0 0 40px #ffffff,
0 0 80px #ffffff,
0 0 120px #ffffff,
0 0 160px #ffffff;
}