简单的按钮问题在IE中

时间:2011-08-11 13:11:53

标签: html

我还发现按钮适用于Firefox但不适用于IE。你知道为什么吗?

<td><a href="crt.php"><button>Create New Listing</button></a></td>

5 个答案:

答案 0 :(得分:2)

<td><button type="button" onclick="location.replace('/crt.php')">Create New Listing</button></td>

我认为这更像是你所追求的。我不知道你是否可以使用像你想要的按钮一样。

答案 1 :(得分:1)

忽略浏览器实际可行的实际情况,根据HTML5规范,您在button内无法a

http://developers.whatwg.org/text-level-semantics.html#the-a-element

  

a元素
  内容模型:透明,但必须没有交互式内容   后代。

http://developers.whatwg.org/content-models.html#interactive-content

  

交互式内容是专门面向用户的内容   相互作用。

     
      
  • a
  •   
  • button
  •   
  • ...
  •   

答案 2 :(得分:0)

我猜你想要一个提交按钮?这实际上是一个INPUT标签。 FORM标签将使其转到您想要的页面。

<form action="crt.php" method="get">
<input type="submit" value="Create New Listing" />
</form>

您也可以使用JavaScript。

答案 3 :(得分:0)

http://www.w3schools.com/tags/tag_button.asp

  

始终指定按钮的type属性。的默认类型   Internet Explorer是“按钮”,而在其他浏览器中(以及在W3C中)   规范)它是“提交”。

答案 4 :(得分:0)

<td>
    <form action="crt.php">
        <input type="submit" value="Create New Listing">
    </form>
</td>