图片/图形

CSS3图片鼠标悬停动画特效

阿里云


这是一款 CSS3 图片鼠标悬停动画特效。该特效在鼠标悬停到图片上面的时候,利用 CSS3 制作上下关门的动画效果,非常炫酷。

HTML 结构

基本的 HTML 结构如下

也想出现在这里?联系我们
创客主机
  1. <div class="container">
    
  2.     <div class="row">
    
  3.         <div class="col-md-4 col-sm-6">
    
  4.             <div class="box">
    
  5.                 <img src="images/img-1.jpg" alt="">
    
  6.                 <div class="box-content">
    
  7.                     <h3 class="title">Williamson</h3>
    
  8.                     <span class="post">web developer</span>
    
  9.                 </div>
    
  10.                 <ul class="icon">
    
  11.                     <li><a href="#"><i class="fa fa-search"></i></a></li>
    
  12.                     <li><a href="#"><i class="fa fa-link"></i></a></li>
    
  13.                 </ul>
    
  14.             </div>
    
  15.         </div>
    
  16.         <div class="col-md-4 col-sm-6">
    
  17.             <div class="box">
    
  18.                 <img src="images/img-2.jpg" alt="">
    
  19.                 <div class="box-content">
    
  20.                     <h3 class="title">Kristina</h3>
    
  21.                     <span class="post">web designer</span>
    
  22.                 </div>
    
  23.                 <ul class="icon">
    
  24.                     <li><a href="#"><i class="fa fa-search"></i></a></li>
    
  25.                     <li><a href="#"><i class="fa fa-link"></i></a></li>
    
  26.                 </ul>
    
  27.             </div>
    
  28.         </div>
    
  29.         <div class="col-md-4 col-sm-6">
    
  30.             <div class="box">
    
  31.                 <img src="images/img-3.jpg" alt="">
    
  32.                 <div class="box-content">
    
  33.                     <h3 class="title">Miranda Roy</h3>
    
  34.                     <span class="post">web developer</span>
    
  35.                 </div>
    
  36.                 <ul class="icon">
    
  37.                     <li><a href="#"><i class="fa fa-search"></i></a></li>
    
  38.                     <li><a href="#"><i class="fa fa-link"></i></a></li>
    
  39.                 </ul>
    
  40.             </div>
    
  41.         </div>
    
  42.     </div>
    
  43. </div>

CSS 样式

  1. .box{
  2.     font-family: 'Ubuntu', sans-serif;
  3.     overflow: hidden;
  4.     position: relative;
  5.     transition: all 0.3s;
  6. }
  7. .box:hover{ box-shadow: 0 0 15px -5px #000; }
  8. .box:before{
  9.     content: '';
  10.     background-color: transparent;
  11.     background-image:
  12.         radial-gradient(circle at 20% 80%, transparent 29%, rgba(255,255,255,0.4) 30%, rgba(255,255,255,0.4) 33%, transparent 34%),
  13.         radial-gradient(circle at 80% 20%, transparent 29%, rgba(255,255,255,0.4) 30%, rgba(255,255,255,0.4) 33%, transparent 34%);
  14.     background-size: 30px 30px;
  15.     height: 100%;
  16.     width: 100%;
  17.     opacity: 0;
  18.     position: absolute;
  19.     left: 0;
  20.     top: 0;
  21.     z-index: 1;
  22.     transition: all 0.3s ease 0.2s;
  23. }
  24. .box:hover:before{ opacity: 1; }
  25. .box img{
  26.     width: 100%;
  27.     height: auto;
  28.     transition: all 0.3s ease 0s;
  29. }
  30. .box:hover img{ filter:blur(2px); }
  31. .box .box-content{
  32.     color: #fff;
  33.     background-color: rgba(0,0,0,0.6);
  34.     text-align: center;
  35.     width: 100%;
  36.     height: 59%;
  37.     padding: 18% 0 0 0;
  38.     position: absolute;
  39.     left: 0;
  40.     top: -100%;
  41.     z-index: 2;
  42.     transition: all 0.3s ease 0s;
  43. }
  44. .box:hover .box-content{ top: 0; }
  45. .box .title{
  46.     color: #fff;
  47.     font-size: 23px;
  48.     font-weight: 600;
  49.     letter-spacing: 1px;
  50.     text-transform: uppercase;
  51.     margin: 0;
  52. }
  53. .box .post{
  54.     color: #32c287;
  55.     font-size:14px;
  56.     font-style: italic;
  57.     text-transform: capitalize;
  58.     letter-spacing: 2px;
  59. }
  60. .box .icon{
  61.     background: rgba(50,194,135,0.6);
  62.     text-align: center;
  63.     height: 39%;
  64.     width: 100%;
  65.     padding: 15px 0 0;
  66.     margin: 0;
  67.     list-style: none;
  68.     transform: translateX(50%);
  69.     position: absolute;
  70.     right: 50%;
  71.     bottom: -100%;
  72.     z-index: 1;
  73.     transition: all 0.3s;
  74. }
  75. .box:hover .icon{ bottom: 0; }
  76. .box .icon li{
  77.     display: inline-block;
  78.     margin: 0 3px;
  79. }
  80. .box .icon li a{
  81.     color: #32c287;
  82.     background-color: #fff;
  83.     font-size: 18px;
  84.     line-height: 40px;
  85.     height: 40px;
  86.     width: 40px;
  87.     border-radius: 40%;
  88.     display: block;
  89.     transition:all 0.3s;
  90. }
  91. .box .icon li a:hover{
  92.     color: #fff;
  93.     background-color: #04a562;
  94.     box-shadow: 0 0 0 3px rgba(255,255,255,0.5),0 0 5px rgba(0,0,0,0.5) inset;
  95. }
  96. @media only screen and (max-width:990px){
  97.     .box{ margin-bottom: 30px; }
  98. }
  99. @media only screen and (max-width:479px){
  100.     .box .title{ font-size: 20px; }
  101. }

CSS3 图片鼠标悬停动画特效

已有 405 人购买
  • 06lh
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(1)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!