开发者

html emails - problem with <button> inside <a> tags?

The following looks fine but when i test it in gmai开发者_Go百科l, it opens the link twice (in 2 new tabs), it's as if there's some kind of wierd event bubbling happening....

<a href="some_url"> <button>Approve</button> </a>

am i missing something obvious?


A link can't contain a button. Either use a button or style the link like a button (i.e. that it looks like a button).

That said: The event bubbling is probably happening because the button does it's job and then, the link processes the mouse click event, too.


The obvious thing is that this is not properly formatted [X]HTML.
An <a> should not include a <button>


There are browsers that will not even allow the link to be clicked. Style the href instead

<a href="" style="text-decoration:none; border-top: 2px #cce3ff solid; border-left: 2px #cce3ff solid; border-bottom: 2px #31557f solid;border-right: 2px #31557f solid;">GO</a>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜