嵌套< a>里面<按钮>在Firefox中不起作用 [英] Nesting <a> inside <button> doesn't work in Firefox

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

问题描述

我有一个带有超链接标签的< button> ,如下所示:

I have a <button> with a hyperlink tag inside, looks like this:

<button class="btn"><a href="#"></a></button>

在Chrome和Safari中运行良好,但在Firefox(版本20测试版)中不起作用。

This works well in Chrome and Safari, BUT doesn't work in Firefox (ver 20 tested).

有什么不对?

推荐答案

,你也必须把Firefox改成

To make it work in all browser, Firefox too you have to change it to

<a href="#"><button class="btn"></button></a>

或者像Billy Moat建议的那样,在bootstrap中不需要 < button>< / code>您可以这样做:

or as suggested by Billy Moat in case of bootstrap there was no need of <button> you could just do

<a href="#" class="btn">GO</a>

这篇关于嵌套&lt; a&gt;里面&lt;按钮&gt;在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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