问题描述
我的网站上有许多使用按钮标签的按钮,虽然在 IE8 上呈现良好,但它们不可点击(点击它们不会将用户发送到新网址).有什么解决方案可以为 IE 解决这个问题吗?是因为我将按钮包装在标签中吗?是不是因为我使用了按钮"的类名?
I have a number of buttons on my website using the button tag, and while rendering fine on IE8, they are not clickable (clicking them doesn't send the user to the new url). Are there any solutions to fix this for IE? Is it because I'm wrapping the button in an tag? Is it because I'm using a class name of "button"?
代码是:
<a href="product_home.html">
<button class="button green big_button">Learn more</button>
</a>
推荐答案
你的标记是错误的,这里不是 IE 的错误.按钮是一个表单元素,这意味着它需要一个表单围绕它应该发送用户的点 - 将按钮包装到链接标签中是不够的,也不完全有效,事实上我认为它不应该在任何地方工作,不是即使在其他浏览器中.
Your markup is wrong, IE is not in fault here. Button is a form element which means that it requires a form around it point where the user should be sent - wrapping the button into a link tag isn't enough nor exactly valid, in fact I don't think it should work anywhere, not even in other browsers.
要了解有关正确使用 <button/>
的更多信息,请访问 XHTML 参考:按钮
To read more about correct usage of <button/>
, visit XHTML Reference: button
这篇关于<按钮>不能在 IE8 中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!