Efecto (la dirección del disco de red del código fuente está al final)
¡Atentos a la cuenta pública "Moviendo el Mundo" para ver más videotutoriales!
código fuente
índice.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: " ";