Tips:
1.第二个属性值必须跟上单位(s)
2.谁要过渡给谁加
图标转换最终效果:当鼠标划过图标时,缓慢转换成另一个图标
<body>
<section class="logo">
<div class="both">
<div class="left">?</div>
<div class="right">?</div>
</div>
</section>
</body>
.logo {
width: 56px;
height: 56px;
margin: 20px auto;
background-color: rgb(255, 111, 55);
line-height: 56px;
border-radius: 16px;
}
.both {
width: 112px;
height: 56px;
font-family: ‘icomoon‘;
font-size: 45px;
text-align: center;
}
.left,
.right {
float: left;
padding: 0 5px;
}
.logo:hover .both {
margin-left: -56px;
}
.logo {
width: 56px;
height: 56px;
margin: 20px auto;
background-color: rgb(255, 111, 55);
line-height: 56px;
border-radius: 16px;
overflow: hidden;
}
.both {
width: 112px;
height: 56px;
font-family: ‘icomoon‘;
font-size: 45px;
text-align: center;
transition: all .7s;
}
原文:https://www.cnblogs.com/ben-studying/p/14645026.html