Link inside a button not working in Firefox

This doesn’t work because it is not allowed by HTML5:

Content model: Phrasing content, but there must be no interactive
content descendant.

Interactive content means any of the following elements:

a audio (if the controls attribute is present) button details embed
iframe img (if the usemap attribute is present) input (if the type
attribute is not in the hidden state) keygen label menu (if the type
attribute is in the toolbar state) object (if the usemap attribute is
present) select textarea video (if the controls attribute is present)

If it does work in some browsers it’s just because they’re trying to
play nice with malformed markup and provide some sort of meaningful result.

In other words: rewrite your HTML, it’s a mess. If you want the links to look like they’re in a button, put them in a div element and style that to look like one, instead of abusing semantically wrong elements for it.

Leave a Comment