transform和transiton写在hover里都能实现功能
但是,hover 中写 transform,减少bug
示例如下
transform
&:hover {
background-color: #fff !important;
span:last-child {
transform: rotate(-180deg);
}
transition
span:last-child {
font-size: 8px !important ;
display: inline-block;
transition: all 1s linear;
}
此处实现的效果为:逆时针旋转180deg