div+css实现图片悬浮图文三维翻转效果代码

代码语言:html

所属分类:悬停

代码描述:div+css实现图片悬浮图文三维翻转效果代码

代码标签: div css 图片 悬浮 图文 三维 翻转

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        *,
        ::before,
        ::after {
            position: relative;
            box-sizing: border-box;
        }
        
        body {
            background-color: black;
            color: white;
            display: flex;
            align-items: center;
            height: 100vh;
        
        }
        
        /* Card */
        .card {
            border: 2px solid white;
            box-shadow: 0px 0px 5px white;
            padding: 2em;
            max-width: 250px;
            width: 100%;
            text-align: center;
            margin: auto;
            font-size: 18x;
            background: black;
            transform-style: preserve-3d;
            transition: 1.5s ease;
          
          
        }
        
        .card:hover {
            transform: rotateY(.5turn);
        }
        
        /* Content */
        .card .content {
            transform-style: preserve-3d;
            transition: 1s ease;
          
        }
        
        .card .back, .card .front {
            transform-style: preserve-3d;
            backface-visibility: hidden;
            
            display: flex;
            flex-direction: column;
          
        }
        
        .card {
          text-shadow: 0 0 5px black;
        }
        
        .card .back {
            transform: rotateY(.5turn);
            
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0