赞
踩
<button class="btn">悬浮动画</button>
.btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 20px; width: 200px; height: 50px; background-color: transparent; border-radius: 5px; border: 2px solid powderblue; color: powderblue; font-weight: bold; transition: all 1s; overflow: hidden; &::before { content: ""; position: absolute; height: 100%; width: 0; left: -30px; top: 0; background-color: powderblue; transform: skewX(45deg); transition: all 1s; z-index: -1; } &:hover { color: white; &::before { width: 180%; } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。