Effet (l'adresse du disque réseau du code source est à la fin)
Faites attention au compte public "Moving the World" pour voir plus de tutoriels vidéo !
code source
index.html
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title> CSS 鼠标移出过渡效果</title>
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>靠近我呀</h1>
</body>
</html>
CSS
h1::before {
transform: scaleX(0);
transform-origin: bottom right;
}
h1:hover::before {
transform: scaleX(1);
transform-origin: bottom left;
}
h1::before {
content: " ";