5 回答
TA贡献50条经验 获得超32个赞
参考一楼代码,稍微加点动画渐变,代码如下。
<!DOCTYPE html>
<html>
<head>
<style>
.arrow {
width: 65px;
height: 50px;
background: #000;
padding: 30px 0 0 30px;
margin:30px auto 0;
position: relative;
}
.arrow i {
display: block;
width: 50px;
height: 5px;
background: #fff;
position: absolute;
border-radius: 10px 0 0 10px;
transition:all 300ms;
}
.arrow i:nth-of-type(1) {
width: 35px;
top:20px;
}
.arrow i:nth-of-type(2) {
width: 35px;
top:35px;
}
.arrow i:nth-of-type(3) {
width: 35px;
top:50px;
}
.arrow:hover i{
border-radius: 0;
height: 3px;
}
.arrow:hover i:nth-of-type(1){
top:35px;
transform-origin: left center;
transform: rotate(-45deg);
}
.arrow:hover i:nth-of-type(2){
width: 55px;
margin-left:-1px;
border-radius: 10px 0 0 10px;
}
.arrow:hover i:nth-of-type(3){
top:35px;
transform-origin: left center;
transform: rotate(45deg);
}
</style>
</head>
</body>
<div class="arrow">
<i></i>
<i></i>
<i></i>
</div>
</body>
</html>
其实我真的不是东北人
TA贡献3593条经验 获得超1个赞
TA贡献105条经验 获得超66个赞
<!DOCTYPE html>
<html>
<head>
<style>
* {
margin:0;
padding:0;
}
.arrow {
width: 80px;
height: 50px;
background: #000;
padding: 30px 0 0 30px;
margin:30px auto 0;
position: relative;
}
.arrow i {
display: block;
width: 50px;
height: 5px;
background: #fff;
position: absolute;
border-radius: 10px 0 0 10px;
}
.arrow i:nth-of-type(1) {
width: 35px;
transform-origin: left center;
transform: rotate(-35deg);
}
.arrow i:nth-of-type(3) {
width: 35px;
transform-origin: left center;
transform: rotate(35deg);
}
</style>
</head>
</body>
<div class="arrow">
<i></i>
<i></i>
<i></i>
</div>
</body>
</html>
添加回答
举报

