css - 关于transition
本文介绍了css - 关于transition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我让滑块从左到右 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 属性。
这篇关于css - 关于transition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文