What was the catalyst behind this trend? I just don’t understand the reason behind it. Hasn’t <button> been around forever? Was there some limitation on the button tag that made the div tag more desirable?
What was the catalyst behind this trend? I just don’t understand the reason behind it. Hasn’t <button> been around forever? Was there some limitation on the button tag that made the div tag more desirable?
There’s no good reason to just not use buttons these days, but for a long time that wasn’t the case (cross platform).
And, as you mention, the default styling was typically "make it look like the button in the underlying OS".
So there was a lot of inertia from existing code, examples, and docs that predated buttons. And a (misinformed) avoidence of it when it did appear because of styling.
Since it's introduction, jQuery was born and died. Backbone was created and became obsolete. React took over the internet. Webpack, babel, and node were invented.
With all that change, I think it's safe to say web technologies are adopted or not based on inertia.
I think you are being over-generous.
On the other hand, the Compose "button" in gmail is ... a <div>:
<div class="T-I T-I-KE L3" style="user-select: none" role="button" tabindex="0" jscontroller="eIu7Db" jsaction="click:dlrqf; clickmod:dlrqf" jslog="20510; u014N:cOuCgd,Kr2w4b" gh="cm">Compose</div>
FWIW, my issue with using divs is not that they should never be used as buttons. It's that few people who use them that way go to the effort of doing it correctly. It's absolutely possible to do it right and have a functioning/ accessible js button.
Either go the full way and do it right—with accessibility—or just style the standard components. In most cases the latter is the easiest way to go if you care about getting it right.
It looked good. But hardly worked.
Apparently the web hasn't really changed in that part: we're still churning out HTML that hardly works, but "looks good".
Also, FWIW some of the problem is with the browser makers (still!!). CSS still has a lot of browser specific quirks when working with some components.
This subthread is about why divs are used for buttons and why developers reimplement existing HTML components poorly. Good designers help their teams avoid this, good engineers work with their designers to avoid it.
0: https://www.gov.uk/government/organisations/government-digit...
Designers absolutely need to be aware of and work within their platform's constraints, like a painter needs to understand and work with the physical characteristics of their canvas. It's this kind of mentality that results in visual specs that read "Make the window look exactly, to the pixel, like this Photoshop image!"
It’s funny - I’d expect an interior designer to know something about the limitations of the materials they work with.
Why don’t we expect this of digital designers?
I think that's somewhat like what the relationship between designers and developers should be.
"button are special element and their content is always vertically aligned by default. Even all the propertise are the same, if you don't center the text in the link, you won't get the same visual"
https://stackoverflow.com/questions/64766922/what-can-make-t...