Css实例制作“荷花盛开”代码演示
步骤如下:
1.构建HTML框架,主要是一个大盒子box,里面包裹着小盒子,也就是要盛开的莲花花瓣。
2.基础的CSS效果,制作出莲花的初始形态。
#box{
width:1000px;
height:800px;
margin:0 auto;
margin-top:50px;
position:relative;
}
.box01,.box02,.box03,.box04,.box05,.box06,.box07,.box08,.box09{
width:300px;
height:300px;
border-radius:300px 0;
background:pink;
opacity:0.6;
position:absolute;
bottom:100px;
left:500px;
transform-origin:0 300px;
transform:rotate(-45deg);
transition:all 8s;
}
3.添加hover效果,这样就可以实现莲花盛开的效果了。
#box:hover .box01{
transform:rotate(-23deg);
}
#box:hover .box02{
transform:rotate(0deg);
}
#box:hover .box03{
transform:rotate(23deg);
}
#box:hover .box04{
transform:rotate(45deg);
}
#box:hover .box06{
transform:rotate(-68deg);
}
#box:hover .box07{
transform:rotate(-90deg);
}
#box:hover .box08{
transform:rotate(-113deg);
}
#box:hover .box09{
transform:rotate(-135deg);
}
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: Css实例制作“荷花盛开”代码演示
本文地址: https://pptw.com/jishu/667082.html
