css 鼠标经过图片效果


1.伪类边框线

            <div class="dxd_border">
                <img src="" alt="">
            </div>

 

复制代码
.dxd_border{
    position: relative;
    overflow: hidden;
}
.dxd_border::before,
.dxd_border::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    transition: all 0.4s ease-out 0s;
     visibility: hidden;
}

.dxd_border::before {
    left: 0;
    top: 0;
    border-top: 2px solid #445e9f;
    border-left: 2px solid #445e9f;
}

.dxd_border:after {
    right: 0;
    bottom: 0;
    border-right: 2px solid #445e9f;
    border-bottom: 2px solid #445e9f;
}

.dxd_border:hover::before,
.dxd_border:hover::after {
    width: 100%;
    height: 100%;
    visibility: visible;   
}
复制代码

 

 (2).伪类边框
复制代码
dxd::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    bottom: 0;
    right: 0;
    border: 0px solid rgba(255, 255, 255, 0.4);
    -webkit-transition: all .25s;
    -moz-transition: all .25s;
    -ms-transition: all .25s;
    -o-transition: all .25s;
    transition: all .25s;
}

dxd:hover:after {
    border-width: 20px;
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM