CSS3實現圖片放大旋轉

來源:互聯網
上載者:User

標籤:css3動畫

知識點:

    css3動畫

    transition


    /*旋轉動畫*/

@-webkit-keyframes rotation{

from {-webkit-transform: rotate(0deg);}

to {-webkit-transform: rotate(360deg);}

}

效果:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/73/9C/wKiom1YCHS_z-xTYAATheSQ04Eg944.jpg" title="360反饋意見16591009115125131.png" alt="wKiom1YCHS_z-xTYAATheSQ04Eg944.jpg" />

源碼:

-----------------------

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>圖片過渡縮放</title>

<style>

/*通用樣式*/

*{margin: 0;padding: 0;}

/*自訂樣式*/

.img{margin-left: 25px;margin-top: 50px;margin-right: 25px;

    transition: all 2s ease;

}

.img:hover{

z-index: 10;

border: 1px dashed #ff0000;

-webkit-transform: rotateY(360deg);

transform: scale(1.51,1.51) rotate(360deg);

}

.ta_c{text-align: center;

width: 99%;

}

/*旋轉動畫*/

@-webkit-keyframes rotation{

from {-webkit-transform: rotate(0deg);}

to {-webkit-transform: rotate(360deg);}

}

</style>

</head>

<body>

<div class="ta_c">

<img  src="img/1.jpg" width="25%" class="img" />

<img  src="img/2.jpg" width="25%" class="img" />

<img  src="img/3.jpg" width="25%" class="img" />

<img  src="img/4.png" width="25%" class="img" />

<img  src="img/5.jpg" width="25%" class="img" />

<img  src="img/6.jpg" width="25%" class="img" />

</div>

</body>

</html>

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/73/99/wKioL1YCHYyzfdDXAAJJ_Rdv2Bc883.jpg" title="dzq-blog.png" alt="wKioL1YCHYyzfdDXAAJJ_Rdv2Bc883.jpg" />

本文出自 “wennuanyiran” 部落格,請務必保留此出處http://dingzhaoqiang.blog.51cto.com/5601059/1697390

CSS3實現圖片放大旋轉

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.