(3)rotateZ 举例:
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> .rotateZ { width: 330px; height: 227px; margin: 100px auto; /* 透视*/ perspective: 200px; } img { transition: all 1s; } .rotateZ:hover img { transform: rotateZ(360deg); } </style> </head> <body> <div class="rotateZ"> <img src="//img.yd166.com/images/z.jpg" alt=""/> </div> </body> </html>
效果:
案例:百度钱包
现在有下面这张图片素材:
要求做成下面这种效果:
上面这张图片素材其实用的是精灵图。实现的代码如下: