test.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. <style>
  5. * {
  6. padding:0;
  7. margin:0;
  8. }
  9. .pkbox {
  10. width:155px;
  11. height:219px;
  12. position:relative;
  13. margin:300px auto;
  14. }
  15. .pkbox > img {
  16. width:100%;
  17. height:100%;
  18. position:absolute;
  19. left:0;
  20. top:0;
  21. /*添加过渡*/
  22. transition:transform 2s;
  23. /*设置旋转轴心*/
  24. transform-origin:right top;
  25. }
  26. /*添加鼠标上移的效果*/
  27. .pkbox:hover >img:nth-of-type(1) {
  28. transform:rotate(60deg);
  29. }
  30. .pkbox:hover >img:nth-of-type(2) {
  31. transform:rotate(120deg);
  32. }
  33. .pkbox:hover >img:nth-of-type(3) {
  34. transform:rotate(180deg);
  35. }
  36. .pkbox:hover >img:nth-of-type(4) {
  37. transform:rotate(240deg);
  38. }
  39. .pkbox:hover >img:nth-of-type(5) {
  40. transform:rotate(300deg);
  41. }
  42. .pkbox:hover >img:nth-of-type(6) {
  43. transform:rotate(360deg);
  44. }
  45. </style>
  46. </style>
  47. </head>
  48. <body>
  49. <div class="pkbox">
  50. <img src="http://www.jq22.com/img/cs/300x500-1.png" alt="">
  51. <img src="http://www.jq22.com/img/cs/300x500-2.png" alt="">
  52. <img src="http://www.jq22.com/img/cs/300x500-3.png" alt="">
  53. <img src="http://www.jq22.com/img/cs/300x500-4.png" alt="">
  54. <img src="http://www.jq22.com/img/cs/300x500-5.png" alt="">
  55. <img src="http://www.jq22.com/img/cs/300x500-6.png" alt="">
  56. </div>
  57. </body>
  58. </html>