CSS鼠标悬停卡片反转效果
XML/HTML Code
- <div id="main">
- <ul>
- <li> <img src="img/1a.jpg" alt="Iron Man 1" width="300" height="450" />
- <div class="info">
- <h2>Iron Man 1</h2>
- <p>freejs.net</p>
- <a href="#">More info</a>
- </div>
- </li>
- <li> <img src="img/1b.jpg" alt="Iron Man 2" width="300" height="450" />
- <div class="info">
- <h2>Iron Man 2</h2>
- <p>freejs.net</p>
- <a href="#">More info</a>
- </div>
- </li>
- </ul>
- </div>
CSS Code
- *{margin:0;padding:0;font-family:"Arial";}
- body{background:#222222}
- #main{width:962px;height:473px;margin:10px auto;}
- #main ul{list-style:none;}
- #main ul li{width:320px;height:470px;float:left;position:relative;}
- #main ul li img{border:10px solid #F5F5F5;-webkit-transition:1s ease;-moz-transition:1s ease;}
- #main .info{width:240px;height:230px;border:10px solid #F5F5F5;background:#deddcd;position:absolute;bottombottom:-50px;rightright:0;-webkit-transition:1s ease;-moz-transition:1s ease;-moz-transform:rotatey(30deg);-webkit-transform:rotatey(30deg);}
- #main .info h2{text-align:center;line-height:70px;color:#7a3f3a;font-weight:normal;font-size:20px;}
- #main .info p{padding:0 20px;font-size:14px;}
- #main .info a{display:block;width:100px;height:30px;background:#7a3f3a;color:#FFF;border-radius:5px;text-decoration:none;text-align:center;line-height:30px;margin:10px auto;}
- #main ul li:hover .info{-webkit-transform:rotatey(0deg);-moz-transform:rotatey(0deg);rightright:30px;bottombottom:-70px;}
- #main ul li:hover img{-webkit-transform:rotatey(360deg);-moz-transform:rotatey(360deg);}
原文地址:http://www.freejs.net/article_jquerytupiantexiao_866.html