【问题标题】:I embedded this html button on my website but it doesn't work我在我的网站上嵌入了这个 html 按钮,但它不起作用
【发布时间】:2022-01-08 01:02:21
【问题描述】:

可能的原因是什么?

<!-- # # Code # # -->
<div class="link-item-wrapper">
<a href="https://www.instagram.com/thestackoverflow/" >
<img src="https://www.instagram.com/static/images/ico/apple-touch-icon-76x76-precomposed.png/666282be8229.png" >
</div>
<!-- # # # # # # # -->

观察:

  1. 按钮是可点击的,但什么也没做...
  2. 鼠标中键可以正常打开网站。
  3. 鼠标悬停在左下角正确显示网站。

【问题讨论】:

    标签: html web click


    【解决方案1】:

    它在 Firefox 中对我有用,但您应该在 img 之后明确关闭 a 标记。

    <div class="link-item-wrapper">
    <a href="https://www.instagram.com/thestackoverflow/">
    <img src="https://www.instagram.com/static/images/ico/apple-touch-icon-76x76-precomposed.png/666282be8229.png">
    </a>
    </div>
    

    【讨论】:

    • 当我在 VSC 中使用 live server plugin 进行测试时,我使用了 chrome 并且它可以正常工作,但是当我将相同的代码上传到网站时它不会做任何事情,这是某种故障吗? ?
    • 这对我来说听起来像是一个小故障,我不确定是什么原因造成的。不过,在我看来,这就像代码中其他地方的问题。
    • 看起来它在我在firefox上尝试的代码代码中的其他地方出现了相同的结果,需要重新检查。感谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    相关资源
    最近更新 更多