如何让整个背景图片可点击?

我正在尝试通过电子邮件发送图像,因此我想让整个图像可点击。我期望以 ii 的方式构建代码,因为其他格式不支持。


  <div class="container" style="background: url('https://firebasestorage.googleapis.com/v0/b/growthfilepractice.appspot.com/o/1%20(2).jpg?alt=media&token=48244df9-a2bb-412a-81f5-854e2dbc4939');background-repeat: no-repeat;background-size:500px 500px;height: 500px;margin-left: 20%;">

    <a href ="https://github.com/" style="text-decoration: none;">

      <table>

        <tr>

          <td><h3 style="color: #fff;margin-top: 195px;margin-left:60px;font-weight: 600;font-family:Montserrat;">xyz</h3></td>

        </tr>

        <tr>



        </tr>

      </table>

    </a>

  </div>


牧羊人nacy
浏览 57回答 1
1回答

德玛西亚99

<a href ="https://github.com/"&nbsp; style="width: 500px;height: 500px; position: relative; margin-left: 20%;text-decoration: none; display: block;">&nbsp; <img src="https://firebasestorage.googleapis.com/v0/b/growthfilepractice.appspot.com/o/1%20(2).jpg?alt=media&token=48244df9-a2bb-412a-81f5-854e2dbc4939" style="position: absolute; width: 100%; height: 100%;&nbsp; object-fit: contain; object-position: left top; z-index: -1;">&nbsp; <table style="position: relative; z-index: 1;">&nbsp; &nbsp; <tr>&nbsp; &nbsp; &nbsp; <td><h3 style="color: #fff;margin-top: 135px;margin-left:60px;font-weight: 600;font-family:Montserrat;">xyz</h3></td>&nbsp; &nbsp; </tr>&nbsp; &nbsp; <tr>&nbsp; &nbsp; </tr>&nbsp; </table></a>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5