css3-文字卡片折叠效果
css3-文字卡片折叠效果
html:
<section class="text"> <span>D</span> <span>R</span> <span>E</span> <span>A</span> <span>M</span> </section>
css:
<style> *{ margin: 0; padding: 0; list-style: none; } html,body{ width: 100%; height: 100%; } body{ background-color: #FF90B3; } .text{ width: 600px; margin: 250px auto 100px; display: inline-block; transition: 0.5s; display: flex; } .text span{ background-color: #fff; width: 120px; height: 120px; line-height: 120px; text-align: center; font-family: Arial, Helvetica, sans-serif; color: #a0a0a0; font-size: 40px; transition: 0.3s; } .text:hover span:nth-child(odd){ color: #b5b5b5; box-shadow: 0 60px 20px rgba(0,0,0,0.1); transform: skewY(-10deg); } .text:hover span:nth-child(even){ color: #b5b5b5; box-shadow: 0 60px 20px rgba(0,0,0,0.1); transform: skewY(10deg); } </style>
还没有留言,还不快点抢沙发?