css3箭頭旋轉+向下展開動畫


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>箭頭旋轉+向下展開動畫</title>
<style>
.closeBox {
display: inline-block;
width: 50px;
height: 50px;
transition: transform 0.5s;
-moz-transition: -moz-transform 0.5s; /* Firefox 4 */
-webkit-transition: -webkit-transform 0.5s; /* Safari 和 Chrome */
-o-transition: -o-transform 0.5s;
}

.closeBox img {
width: 100%;
}

.closeBox:hover {
transform: rotate(90deg);
}

.element{
max-height: 60px;
overflow: hidden;
transition: max-height ease-in 0.2s;
background-color: pink;
}
.element:hover{
max-height: 2000px; /*足夠存放內容的高度*/
}
</style>

</head>
<body>
<span class="closeBox" style="margin:0px 120px;" id="btn">
<img src="images/arrow.png" class="close">
</span>
<p></p>
<div class="element">
<div class="box" style="width: 100%;height: 500px"></div>
</div>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM