css+svg实现鼠标悬浮人物照片出框立体效果代码

代码语言:html

所属分类:悬停

代码描述:css+svg实现鼠标悬浮人物照片出框立体效果代码

代码标签: css svg 鼠标 悬浮 人物 照片 出框 立体

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        html, body {
          height: 100%;
          width: 100%;
          padding: 0;
          margin: 0;
        }
        
        body {
          display: flex;
          align-items: center;
          justify-content: center;
          background: #444;
        }
        
        .img-test {
          width: 300px;
          height: 300px;
          position: relative;
        }
        
        .img-test::before {
            content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
            background-color: #ccc;
          clip-path: url(#cut-off-bottom);
          background-image: url("//repo.bfw.wiki/bfwrepo/icon/626f073c91b53.webp");
            background-size: cover;
            transition: background 0.3s ease-in-out;
        }
        
        .img-test::after {
          background-size: cover;
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
              clip-path: url(#mask2);
          transition: top 0.3s ease-in-out;
          z-index: 2;
            background-image: url("//repo.bfw.wiki/bfwrepo/icon/626f073c91b53.webp");
            background-size: cover;
        
        /*   opacity: 0.5; */
        }
        
        .img-test:hover::after {
          top: -20px;
        }
        
        .img-test:hover::before {
        back.........完整代码请登录后点击上方下载按钮下载查看

网友评论0