lt;buttongt; not working in IE8(lt;按钮gt;不能在 IE8 中工作)
问题描述
我的网站上有许多使用按钮标签的按钮,虽然在 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 中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:<按钮>不能在 IE8 中工作


基础教程推荐
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01