将一个按钮放入锚点的任何缺点? [英] Any downside to putting a button inside of an anchor?

查看:110
本文介绍了将一个按钮放入锚点的任何缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个wordpress插件,将FB,Twitter和LinkedIn分享按钮添加到帖子中。我知道这已经完成了一百次,但这是一个很好的练习,我正在努力。是否有任何缺点将按钮放入锚标签内,如此?

I'm building a wordpress plugin to add FB, Twitter, and LinkedIn share buttons to a post. I know it's been done a hundred times, but it's good practice and I'm putting a spin on it. Are there any downsides to putting a button inside of an anchor tag like so?

<a href="#"><input type="submit" value="share to facebook" /></a>

您的想法值得赞赏。

Your thoughts are appreciated.

推荐答案


  1. HTML规范禁止使用

  2. 某些浏览器会导致链接中断

  3. 某些浏览器会导致按钮中断

如果您想要一个看起来像按钮的链接,请使用链接并申请CSS。

If you want a link that looks like a button, then use a link and apply CSS.

如果你想要一个提交按钮,那么不要把它放在一个链接中。

If you want a submit button, then don't put it inside a link.

这篇关于将一个按钮放入锚点的任何缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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