首页 > 开发 > CSS > 正文

css动画+照片清晰度动画的实现方法

2024-07-11 08:32:39
字体:
来源:转载
供稿:网友

实例如下:

源代码:

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPE html>   <html>  
  2. <head>   <title>donghua</title>  
  3. <meta charset="utf-8">   <style type="text/css">  
  4. .beijing{    border: 1px solid black;   
  5. width: 100%;    height: 800px;   
  6. background: black;    }   
  7. .a1 img{    width: 100px;   
  8. height: 100px;    -webkit-filter: blur(2px);   
  9. }    .qq{   
  10. position: absolute;    left: 500px;   
  11. top: 150px;    }   
  12. .qq img:hover{    animation-name: one;   
  13. animation-duration: 3s;    animation-fill-mode: forwards;   
  14. }    @keyframes one{   
  15. 0%{width: 200px;height: 200px;-webkit-filter:blur(4px);}    25%{width: 400px;height: 400px;-webkit-filter:blur(3px);}   
  16. 80%{width: 600px;height: 600px;-webkit-filter:blur(2px);}    100%{width: 800px;height: 800px;-webkit-filter:blur(0px);}   
  17. }    .ww{   
  18. position: absolute;    left: 540px;   
  19. top: 180px;    }   
  20. .ww img:hover{    animation-name: one;   
  21. animation-duration: 5s;    animation-fill-mode: forwards;   
  22. }    .ss{   
  23. position: absolute;    left: 550px;   
  24. top: 240px;    }   
  25. .ss img:hover{    animation-name: one;   
  26. animation-duration: 5s;    animation-fill-mode: forwards;   
  27. }    .tt{   
  28. position: absolute;    left: 560px;   
  29. top: 260px;    }   
  30. .tt img:hover{    animation-name: one;   
  31. animation-duration: 5s;    animation-fill-mode: forwards;   
  32. }    .oo{   
  33. position: absolute;    left: 590px;   
  34. top: 300px;    }   
  35. .oo img:hover{    animation-name: one;   
  36. animation-duration: 5s;    animation-fill-mode: forwards;   
  37. }    </style>  
  38. </head>   <body>  
  39. <div class="beijing">   <div class="a1 qq"><img src="43a7d933c895d143b233160576f082025aaf074a.jpg"></div>  
  40. <div class="a1 ww"><img src="03087bf40ad162d9ec74553b14dfa9ec8a13cd7a.jpg"></div>   <div class="a1 ss"><img src="b151f8198618367ac7d2a1e92b738bd4b31ce5af.jpg"></div>  
  41. <div class="a1 tt"><img src="023b5bb5c9ea15cec72cb6d6b2003af33b87b22b.jpg"></div>   <div class="a1 oo"><img src="c2cec3fdfc03924578c6cfe18394a4c27c1e25e8.jpg"></div>  
  42. </div>   </body>  
  43. </html>  
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表