WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Do Web developers tend to dislike the button element?

for

From: Patrick H. Lauke
Date: Aug 12, 2020 2:35PM


Historically, <button> elements used to be very stubborn against
restyling cross-browser. One of the last annoying issues nowadays is in
IE11 (where still supported by a site), where by default <button> has a
visible "dipping" behaviour of one or two pixels when active, and it
needs a lot of fiddling (last time I looked, including an additional
wrapper element) to get rid of that.

There also used to be some funky behaviour when it came to events,
bubbling, etc in some browsers. That has luckily gone by the wayside now...

Because of this history, a lot of articles, how-tos, libraries, etc used
other elements like <a href="#"> or <span>s and <div>s...and this
tradition stuck.

--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke