[whatwg] a and button

Tab Atkins Jr. jackalmage at gmail.com
Mon Oct 20 06:10:32 PDT 2008


On Mon, Oct 20, 2008 at 7:32 AM, Julian Reschke <julian.reschke at gmx.de>wrote:

> Håkon Wium Lie wrote:
>
>> I'd like to have a simple way of using <button> along with <a> to
>> create pretty links. This markup works in Opera, Mozilla, and Webkit:
>>
>>  <a href="http://www.w3.org/"><button>W3C</button></a>
>>
>> but it's not valid HTML5 it seems. I propose to make it valid.
>>
>> The inverse (a inside button) only works in Webkit.
>> ...
>>
>
> So a link that looks like a button? Maybe I'm missing something, but why
> would you ever want that?
>
> Users are trained that there's a difference between following links and
> pressing buttons, so it seems to be a bad idea to blur that distinction.
>
> Of course, buttons that look like links are a much bigger problem.
>
> BR, Julian
>

Not really.  To a user, a button just means "press this to go to another
page, possibly also submitting a form".  We're well trained to accept
buttons as plain links, though - just look at how many navs are styled in a
button-like manner.

Even within the context of "press a button to do something with a form",
it's reasonable to want your buttons and links styled the same.  Say you
have a Submit and a Cancel button.  Submit would post the form, while Cancel
would just be a bare link out to some other page.  In this case, you want
both to have similar looks so as to present a cohesive UI.

(I have no particular opinion on Hakon's proposal, though.  I get around
this by never using plain <button>s - mine are always styled in such a way
that links can copy.)

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081020/30d0094d/attachment-0001.htm>


More information about the whatwg mailing list