[关闭]
@dooy 2017-09-28T02:33:36.000000Z 字数 2229 阅读 145

HTML CSS hover特效

JS


1.hover 新特效

  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>hover</title>
  5. <style type="text/css">
  6. body{margin:0 auto;}
  7. ul,li{margin:0; padding: 0; list-style: none;}
  8. .hover-w{background: #373d41 none repeat scroll 0 0;}
  9. .hover-w ul{margin: 0 auto; width:1000px; }
  10. .hover-w ul::after, .hover-w ul::before{ clear:both; content: " "; display: table }
  11. .hover-w ul li{float: left; width: 25%; height: 330px; background-color: #fff; position: relative;cursor: pointer; }
  12. .hover-w ul li img{width: 100%; height: 100%; }
  13. .hover-w ul li .bg{bottom: 0;left: 0;opacity: 0.6;position: absolute;right: 0; top: 0; background: #161a1d none repeat scroll 0 0; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0s; }
  14. .hover-w ul li .bg.bg-black{ opacity: 0.84; }
  15. .hover-w ul li a{ cursor: pointer; display: block;}
  16. .hover-w ul li .h-content{ position: absolute; bottom: 0;left: 0; right: 0px; top:100px; text-align: center;color: #fff; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0s;}
  17. .hover-w ul li .h-content .h-content-title{ font-size: 30px; font-family: "微软雅黑" ; margin-bottom: 10px; }
  18. .hover-w ul li .h-content .h-content-padding{ margin:20px 20px 0 20px; opacity: 0; }
  19. .hover-w ul li:hover .h-content{ top:40px; }
  20. .hover-w ul li:hover .h-content .h-content-padding{ opacity: 1; }
  21. .hover-w ul li:hover .bg{ background: #00c2de none repeat scroll 0 0; opacity: 0.9; }
  22. </style>
  23. </head>
  24. <body>
  25. <br><br>
  26. <div class="hover-w">
  27. <ul >
  28. <li>
  29. <a href=""><img src="//img.alicdn.com/tps/TB16hkwLXXXXXX6XXXXXXXXXXXX-576-840.jpg"></a>
  30. <div class="bg"></div>
  31. <div class="h-content">
  32. <div class="h-content-title">作文</div>
  33. <div class="h-content-padding">批改网基于语料库和云计算技术提供英语作文自动在线批改服务</div>
  34. </div>
  35. </li>
  36. <li>
  37. <a href=""><img src="//img1.doubanio.com/lpic/s29474827.jpg"></a>
  38. <div class="bg bg-black"></div>
  39. <div class="h-content">
  40. <div class="h-content-title">作文2</div>
  41. <div class="h-content-padding">批改网2基于语料库和云计算技术提供英语作文自动在线批改服务</div>
  42. </div>
  43. </li>
  44. <li>
  45. <a href=""><img src="//img1.doubanio.com/lpic/s29474829.jpg"></a>
  46. <div class="bg"></div>
  47. <div class="h-content">
  48. <div class="h-content-title">作文3</div>
  49. <div class="h-content-padding">批改网基于语料库和云计算技术提供英语作文自动在线批改服务</div>
  50. </div>
  51. </li>
  52. <li>
  53. <a href=""><img src="//img1.doubanio.com/lpic/s29474828.jpg"></a>
  54. <div class="bg bg-black"></div>
  55. <div class="h-content">
  56. <div class="h-content-title">作文4</div>
  57. <div class="h-content-padding">批改网2基于语料库和云计算技术提供英语作文自动在线批改服务</div>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. </div>
  63. </body>
  64. </html>
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注