| 字数统计: 468(字) CSS3实现旋转照片墙 发表于 2016-09-04 | 分类于 前端 | 阅读次数 CSS3实现旋转照片墙效果代码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>CSS3 transform旋转特效</title> <style> body{ background-color:#eee;}h1{ text-align:center;}.container{ width:960px; height:450px; margin:60px auto; position:relative;}.container img{ width:300px; height: 400px; padding:10px 10px 15px; background:white; border:1px solid #ddd; box-shadow:2px 2px 3px rgba(50, 50, 50, 0.4); -webkit-transition:all 0.5s ease-in; -moz-transition:all 0.5s ease-in; transition:all 0.5s ease-in; position:absolute; z-index:1;}.container img:hover{ box-shadow:15px 15px 20px rgba(50, 50, 50, 0.4); -webkit-transform:rotate(0deg) scale(1.20); -moz-transform:rotate(0deg) scale(1.20); transform:rotate(0deg) scale(1.20); z-index:2;}.pic1{ left: 400px; top: 0; -webkit-transform: rotate(-5deg); -moz-transform: rotate(-5deg); transform: rotate(-5deg);}.pic2{ top: 0; left: 600px; -webkit-transform: rotate(-20deg); -moz-transform: rotate(-20deg); transform: rotate(-20deg);}.pic3{ bottom: 0; right: 0; -webkit-transform: rotate(5deg); -moz-transform: rotate(5deg); transform: rotate(5deg);} .pic4{ bottom:0; left:300px; -webkit-transform: rotate(-10deg); -moz-transform: rotate(-10deg); transform: rotate(-10deg);}.pic5{ bottom: 0; left: 0; -webkit-transform: rotate(-10deg); -moz-transform: rotate(-10deg); transform: rotate(-10deg);}.pic6{ top: 0; left:0; -webkit-transform: rotate(10deg); -moz-transform: rotate(10deg); transform: rotate(10deg);}.pic7{ top: 0; left: 850px; -webkit-transform: rotate(20deg); -moz-transform: rotate(20deg); transform: rotate(20deg);}.pic8{ bottom: -20px; right: 630px; -webkit-transform: rotate(5deg); -moz-transform: rotate(5deg); transform: rotate(5deg);}.pic9{ top: 90px; left: 550px; -webkit-transform: rotate(15deg); -moz-transform: rotate(15deg); transform: rotate(15deg);}.pic10{ left:180px; top:20px; -webkit-transform: rotate(-10deg); -moz-transform: rotate(-10deg); transform: rotate(-10deg);} </style></head><body> <h1>CSS3照片墙</h1> <div class="container"> <img class="pic pic1" src="images/mm1.jpg"> <img class="pic pic2" src="images/mm2.jpg"> <img class="pic pic3" src="images/mm3.jpg"> <img class="pic pic4" src="images/mm4.jpg"> <img class="pic pic5" src="images/mm5.jpg"> <img class="pic pic6" src="images/mm6.jpg"> <img class="pic pic7" src="images/mm7.jpg"> <img class="pic pic8" src="images/mm8.jpg"> <img class="pic pic9" src="images/mm9.jpg"> <img class="pic pic10" src="images/mm10.jpg"> </div></body></html> 技术点 简单CSS3实现任意设置元素的旋转角 简单CSS3实现图片的等比缩放 利用CSS3将元素的样式变化以动画的方式展现出来。 参考 慕课网 CSS3绚丽照片墙 扫码订阅公众号 如果文章对您有用请随意打赏,谢谢支持! 赏 微信打赏 支付宝打赏 本文作者: AlexZ33 本文链接: http://jxdxsw.com/2016/09/04/css3_picwall/ 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!