Jump to content

Buttons As Links - Works In Everything But Explorer


sempervirent

Recommended Posts

For the user admin area on a social networking site, I've used the underutilized <button> tag to create some CSS-only buttons that function as links. These are not form submission buttons, so I don't want to use the <input> tag instead (which needs an additional unnecessary <form> tag to validate). I want to use the <button> tag instead because... they're buttons.The code looks like this:

<a href="edit_profile.htm"><button class="large green">Edit Profile</button></a>

This type of nesting is perfectly valid in XHTML 1.1, according to the W3. The problem, as usual, lies with Internet Explorer (all versions). The link doesn't go anywhere. I get the dotted outline on the link but the link is never activated and you're not forwarded to the target href of the <a> tag.Is there a workaround for this, or do I have to go back and re-code all those <button> tags to use the <a> tag instead?

Link to comment
Share on other sites

What's the </span> doing in there? That sort of mis-match of tags is the sort of thing that gets IE's knickers in a twist...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...