3 ms·
a11y? I guess div/span don't offer much but I assume the screen readers etc. at least have experience dealing with that vs. randomness.
by password4321 4y ago
a11y?
I guess div/span don't offer much but I assume the screen readers etc. at least have experience dealing with that vs. randomness.
- bryanrasmussen 4y agoone of the things that people not used to a11y get confused by is that since div and span elements carry no information you can't add aria-labels to them (or shouldn't be able to, some readers may be non-compliant on this matter) without an explicit role. However you wouldn't be able to add them to any random element either. Of course divs and spans do get the benefit that they are read as separate elements by screen readers, however this can also be a curse https://stackoverflow.com/questions/60869293/accessibility-readout-multiple-spans-in-div-as-a-single-sentence https://stackoverflow.com/questions/60869293/accessibility-r... Don't know how it would behave with a bunch of readable-segment elements or what have you, as I haven't tested.