我让滑块从左到右 transition设置了all 都有过度效果
请问为何箭头直接到右边 没有效果咧?
a{
box-sizing: border-box;
display: block;
height: 40px;
font-size: 16px;
width: 250px;
line-height: 40px;
background-color: blue;
padding-left: 80px;
position: relative;
border-radius:4px;
color: #fff;
font-weight:bold;
-webkit-transition: all 2s;
}
a::after{
content: '>';
position: absolute;
right: 85%;
}
a:hover{
padding-left: 20px;
}
a:hover::after{
right: 5%;
}
</style>
<!-- 动画 transition -->
This is a link
transition 属性不能继承,你还需要给 after 伪元素设置 transition 属性。
