-13

People really really really like abusing the <kbd> html element for quasi-buttons. The <kbd> element is supposed to be used in situations where we want to signify a keyboard key (e.g. Press Ctrl + C to copy something).

Can we have special markup to create a button, or a button-like element? Just so people stop abusing another element for it?

8
  • 1
    Can you describe the kind of situation, or link to a post, where a button element would be useful? Commented Jul 28, 2016 at 17:59
  • 1
    muh semantic web!
    – user1228
    Commented Jul 28, 2016 at 18:12
  • stackoverflow.com/documentation/proposed/changes/64440 stackoverflow.com/documentation/java/99/… I don't say they would be useful there. But people really want to abuse kbd there to create some kind of quasi snippet like thing.
    – Sumurai8
    Commented Jul 28, 2016 at 18:53
  • 1
    Oh, is this a big thing on that there Documentation doohickey I keep hearing about? Commented Jul 28, 2016 at 19:22
  • People do it on SO too. I just don't see nearly as much answers on SO as I see edit suggestions on Docs right now.
    – Sumurai8
    Commented Jul 28, 2016 at 19:29
  • 2
    I don't think that I've ever seen it. Anyway, I downvoted both posts for not bothering to explain the issue. Commented Jul 28, 2016 at 19:37
  • I guess this would make you nervous :p Commented Jul 28, 2016 at 20:06
  • 1
    @FélixGagnon-Grenier Yes, that makes me feel like burning someone with fire.
    – Sumurai8
    Commented Jul 28, 2016 at 21:44

1 Answer 1

5

Having a replacement will not stop people who want to abuse it, and regular hyperlinks work just fine. If you see someone abusing it, change it to a regular link via editing.

6
  • Why would a hyperlink be a meaningful replacement for a button? Commented Jul 28, 2016 at 18:00
  • 3
    They're still hyperlinks. No one actually wants buttons (that is, the behavior associated with buttons) to be used in these situations; button behavior is a subset of hyperlink behavior, you only lose functionality. The markup looks like a button, but still works like (and is...) a hyperlink. @Nisse. So what you get is a misleading appearance, and... Nothing else.
    – Shog9
    Commented Jul 28, 2016 at 18:01
  • 7
    A misleading appearance is how I got my job and friends. Don't dismiss it too quickly.
    – Bart
    Commented Jul 28, 2016 at 18:07
  • Nobody expects <kbd> elements to behave like actual keypresses. Similarly, I would assume that a <button> element is meant to appear like a button, not actually behave like one. Both posts are still missing some basic explanation. Commented Jul 28, 2016 at 18:10
  • @NisseEngström No, no-one would expect those elements to press actual keys on their keyboard. The correct usage however is to mark them like here or like here.
    – Sumurai8
    Commented Jul 28, 2016 at 19:01
  • 1
    @Sumurai8 both links are dead
    – Ideogram
    Commented Jun 25, 2021 at 7:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .