3D变换

3d旋转轴

perspective: 距离电脑屏幕距离

backface-visibility: 就是把div转过来还显示div的颜色不

perspective-origin

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

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
![](https://user-gold-cdn.xitu.io/2018/9/2/16595e357bd31a92?w=425&h=300&f=png&s=21879)
  <style>
    .fc_wrapper {
      width: 150px;
      height: 235px;
      box-sizing: border-box;
      border: 1px solid #e67e22;
      perspective: 1000px;
    }

    .fc_wrapper:hover .fc_inner {
      transform: rotateY(-180deg) translateZ(0);
    }

    .fc_inner {
      position: relative;
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
      /* backface-visibility: hidden; */
      transform-origin: center center;
      transition: transform 0.8s;
    }

    .fc_front {
      position: absolute;
      z-index: 4;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: red;
      backface-visibility: hidden;
    }

    .fc_back {
      position: absolute;
      z-index: 2;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: blue;
      /* backface-visibility: hidden; */
    }
  </style>
</head>

<body>
  <div class="fc_wrapper">
    <div class="fc_inner">
      <div class="fc_front"></div>
      <div class="fc_back"></div>
    </div>
  </div>
</body>

</html>
复制代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值