<!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>Document</title>
<script src="//at.alicdn.com/t/font_3262440_f0g4iah0fd7.js"></script>
<style type="text/css">
.icon {
width: 1em; height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
div {
height: 100%;
position: relative;
text-align: center;
/* border: 1px solid #000; */
margin-top: 700px;
}
div .icon {
width: 100px;
height: 100px;
transition: all 3s ;
}
div .icon:hover {
width: 0px;
height: 0px;
animation: move2 3s forwards;
}
@keyframes move1 {
0% {
transform: translateY(0px);
}
50% {
/* transform: scale(0.5, 0.5); */
transform: translateY(-300px);
}
100% {
/* transform: scale(0.2, 0.2); */
transform: translateY(-700px);
}
}
@keyframes move2 {
from {
transform: translateY(0px);
}
to {
transform: translateY(-700px);
}
}
</style>
</head>
<body>
<div>
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-huojian"></use>
</svg>
</div>
</body>
</html>
div:hover .icon {
即可。 你的 icon 都飞了, hover 当然也就无了