css实现带倒影卡片图片悬浮翻转动画效果代码

代码语言:html

所属分类:悬停

代码描述:css实现带倒影卡片图片悬浮翻转动画效果代码

代码标签: css 倒影 卡片 图片 悬浮 翻转

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

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background: black;
    }
    
    .scene {
      width: 1000px;
      display: flex;
      justify-content: space-between;
      -webkit-perspective: 800px;
              perspective: 800px;
    }
    .scene .card {
      position: relative;
      width: 240px;
      height: 300px;
      color: white;
      cursor: pointer;
      transition: 1s ease-in-out;
      -webkit-transform-style: preserve-3d;
              transform-style: preserve-3d;
    }
    .scene .card:hover {
      -webkit-transform: rotateY(0.5turn);
              transform: rotateY(0.5turn);
    }
    .scene .card .card__face {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      -webkit-backface-visibility: hidden;
              backface-visibility: hidden;
      transition: 1s ease-in-out;
      -webkit-box-reflect: below 0 linear-gradient(transparent, transparent, rgba(0, 0, 0, 0.4));
    }
    .scene .card .card__face img {
      width: 240px;
      height: 300px;
      -o-object-fit: cover;
         object-fit: cover;
    }
    .scene .card .card__face--back {
      -webkit-transform: rotateY(0.5turn);
              transform: rotateY(0.5turn).........完整代码请登录后点击上方下载按钮下载查看

网友评论0