<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
    <style>
    img {
      display: none;
      width: 100px;
      height: 100px;
    }
    input:checked + img {
      display: block;
    }
    input {
      position: absolute;
      left: -9999px;
    }
    label {
      cursor: pointer;
    }
    </style>
  </head>
  <body>
    <div >
      <input >
      <img src="./img1.png" style="background: red">
      <input >
      <img src="./img2.png" style="background: black">
    </div>
    <div >
      <label for="img1">第一张</label>
      <label for="img2">第二张</label>
    </div>
  </body>
</html>

  

相关文章:

  • 2021-09-02
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-08
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
相关资源
相似解决方案