按钮链接在Firefox,IE中不起作用 [英] Button link doesn't work in Firefox, IE

查看:97
本文介绍了按钮链接在Firefox,IE中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Chrome中使用的链接很好,但不包含IE或Firefox。如果你点击它们,什么都不会发生。我弄乱了CSS(包括z-index),但是没有想法。这是来自Drupal的XHTML。



html看起来像这样:

 < div class =product-display-block-link> 
<按钮>
< a href =/ checkout / outfield-banner / 1>加入购物车< / a>
< / button>
< / div>

有什么建议可以在哪里看?

按钮中的 a 元素。 解决方案元素,所以跨浏览器不起作用就不足为奇了。应该没有理由使用这种构造,因为您可以将链接设置为看起来像按钮或者将操作与按钮相关联,具体取决于您希望完成的操作。


I have links inside of that work fine in Chrome, but not IE or Firefox. Nothing happens if you click on them. I've messed with the CSS (z-index included), but am out of ideas. This is XHTML coming out of Drupal.

The html looks like this:

<div class="product-display-block-link">
  <button>
    <a href="/checkout/outfield-banner/1">Add to cart</a>
  </button>
</div>

Any suggestions for where I can look?

解决方案

The HMTL syntax does not allow an a element within a button element, so it is not surprising that it does not work across browsers. There should be no reason to use such a construct, since you can either style a link to look like a button or associate an action with a button, depending on what you wish to accomplish.

这篇关于按钮链接在Firefox,IE中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆