(编辑:jimmy 日期: 2024/11/13 浏览:2)
代码
<div class="test"> <div></div> <div></div> </div>
.test{ width: 200px; height: 200px; margin-top: 200px; margin-left: 300px; overflow: hidden; background-color: red; } .test div{ width: 100%; height: 100%; transition: 500ms; } .test div:last-child{ background-color: green; } .test:hover div{ transform: translateY(-100%); }