css3鼠标悬停图片特效,图片悬停效果源码

  <style>
        @import url("./style.css");
        *{
            box-sizing: border-box;
        }
        body{
            margin: 0;
            width: 100%;
            height: 100vh;
            font-family: Georgia, 'Times New Roman', Times, serif;
        }
        .header{
            font-size: 24px;
            text-align: center;
        }
        .container{
            width: 100%;
            max-width: 1200px;
            border-radius: 4px;
            margin: 0 auto;
            padding: 40px 0;
        }
        .content{
            display: flex;
            flex-wrap: wrap;
            margin-top: 60px;
            padding: 0 30px;
        }
        .wrapper{
            width: 33.3%;
            height: 100%;
            padding: 10px;
        }
        .name{
            position: relative;
            font-size: 16px;
            display: inline-block;
        }
        .name:after{
            content: "";
            position: absolute;
            width: calc(100% + 10px);
            height: 1px;
            background-color: #000;
            bottom: -4px;
            left: 0;
        }
        .box{
            position: relative;
            max-height: 300px;
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1.4px 1.7px rgba(0, 0, 0, 0.017),0 3.3px 4px rgba(0,0,0,0.024),0 6.3px 7.5px rgba(0,0,0,0.03),0 11.2px 13.4px rgba(0,0,0,0.036), 0 20.9px 25.1px rgba(0,0,0,0.043), 0 50px 60px rgba(0, 0, 0, 0.06);
         }
         .box .hide{
            opacity: 0;
         }
         .box .frame{
            position: absolute;
            border: 1px solid #fff;
            z-index: 2;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
         }
         .box h2, .box p{
            position: absolute;
            color: #fff;
            z-index: 2;
            width: 100%;
            transition: opacity 0.2s,transform 0.3s;
         }
         .box h2{
            font-weight: 500;
            font-size: 22px;
            margin-bottom: 0;
            letter-spacing: 1px;
         }
         .box p{
            bottom: 0;
            font-size: 14px;
            letter-spacing: 1px;
         }
         .box:hover{
            transition: all 0.3s ease-in-out;
         }
         .box:hover::before{
            transition: all 0.3s ease-in-out;
         }
         .box img{
            position: relative;
            width: 100%;
            height: 100%;
            z-index: 1;
            transition: all 0.3s ease-in-out;
         }
         .box img:hover{
            transition: all 0.3s ease-in-out;
         }
         .box img:after{
            content: "";
            position: absolute;
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值