【问题标题】:HTML code not woring in IE?HTML 代码在 IE 中不起作用?
【发布时间】:2013-12-15 21:47:41
【问题描述】:

我正在尝试使用以下代码在我的 HTML 代码中应用跳转到 section\ 函数:

<a href="#BACK_TO_TOP"><input id="To_Top_Button" title="Terug naar zoek Database"></a>

其中引用了如下标记的部分

<a id="BACK_TO_TOP"><img src="../Images/Banner.png" alt=" Header" width="1500" height="152"></a>

这适用于 Chrome 和 Safari,但在 IE 中失败,因为以下在 IE 中有效:

<Strong><i><li type="square"><a href="#C5">Diploma’s</a></li></i></Strong>

链接到以下内容

        <STRONG><font face="Century Gothic" size="2" color="#DC143C">
        <li type="square"><a id="C1">Productontwikkeling...</a></li>
    </font></STRONG>

用于实现此代码的参考位于

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_link_locations

【问题讨论】:

  • 为什么a 标签中有input 元素?
  • 这段代码有很多个问题。如果它在任何浏览器中都可以正常工作,那只能靠运气了。请验证它。

标签: html internet-explorer google-chrome safari href


【解决方案1】:

不能在 HTML 中嵌套交互式元素。 &lt;a&gt;&lt;input&gt; 都是交互式的。

使用a validator(这不是您唯一的错误,尽管它是导致此问题的原因)。

如果您想要一个看起来像按钮的链接,那么从一个链接开始,然后使用标准工具来描述事物的外观:CSS。

【讨论】:

    猜你喜欢
    • 2011-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多