旋转木马动画 相当于改变xyz这三个轴 控制Y轴进行旋转,每张图片旋转36deg,rotateY(36deg) 使用一个动画,将照片进行旋转,使用keyframes动画 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> body { perspective: 10000px; } #box { position: relative; width: 100px; height: 200px; margin: 100px auto; transform-style: preserve-3d; animation: myrotate 10s linear infinite; } @keyframes myrotate{ from { transform: rotateY(0); } to { transform: rotateY(360deg); } } .item { position: absolute; top: 0; left: 0; width: 100px; height: 200px; } .item img { width: 100px; height: 200px; } .item01 { transform: translateZ(300px); } .item02 { transform: rotateY(36deg) translateZ(300px); } .item03 { transform: rotateY(72deg) translateZ(300px); } .item04 { transform: rotateY(108deg) translateZ(300px); } .item05 { transform: rotateY(144deg) translateZ(300px); } .item06 { transform: rotateY(180deg) translateZ(300px); } .item07 { transform: rotateY(216deg) translateZ(300px); } .item08 { transform: rotateY(252deg) translateZ(300px); } .item09 { transform: rotateY(288deg) translateZ(300px); } .item10 { transform: rotateY(324deg) translateZ(300px); } </style></head><body> <div id="box"> <div class="item item01"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item02"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item03"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item04"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item05"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item06"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item07"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item08"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item09"> <img src="../img/baby.jpg" alt=""> </div> <div class="item item10"> <img src="../img/baby.jpg" alt=""> </div> </div></body></html>