示例工程 34-transforms

34-transforms/demo-02-3d/index.html

html · 0.7 KB

运行:3D 翻转

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>3D 翻转</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <input type="checkbox" id="flip" />
    <h1>3D 翻转</h1>
    <p>透视来自父级;卡片绕 Y 轴旋转 180°。</p>
    <label for="flip">翻转</label>

    <div class="scene">
      <div class="card">
        <div class="face front">
          <strong>FRONT</strong>
          <span>正面</span>
        </div>
        <div class="face back">
          <strong>BACK</strong>
          <span>背面</span>
        </div>
      </div>
    </div>
  </body>
</html>