赞
踩
<div class="box">
<div class="item"></div>
</div>
.box { position: relative; } .item { position: absolute; width: 50px; height: 50px; background-color: red; top: 18px; animation: move-up-and-down 2s linear infinite; } @keyframes move-up-and-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
div {
width: 50px;
height: 20px;
background-color: #ccc;
transition: width 1s; /* 宽度变化效果,过渡时间为1秒 */
}
div:hover {
width: 200px; /* 鼠标悬停时的宽度 */
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。