3 ms·
This article isn’t all bad, but it’s not particularly high quality either. <img src=”baby_elephants.png” alt=”A group of two baby elephants walking behind th
by chrismorgan 6y ago
This article isn’t all bad, but it’s not particularly high quality either.
<img src=”baby_elephants.png” alt=”A group of two baby elephants walking behind their mom in a open field.”>
… followed immediately by a demonstration baby elephant image with empty alt text (which in a case like this is worse than no alt attribute, because it tells accessibility tech that the image is purely decorative and should not be announced).
(Note also the use of ” instead of ".)
This is not encouraging.
> You can add a landmark by using the role attribute. Some examples of landmarks are banner, form, and search. Something to note is that you should only place the role attribute on elements like <div> and <span>, do not place on elements that have semantic meaning like a <ul> or <p>.
There is nothing wrong with overriding the role of an element with semantics; it purely comes down to whether you do it correctly. And the thing that they don’t mention here is that the converse applies at least as much: if there’s a built-in element with your desired semantics, you should use that instead of a role, so the example is a bad example: its <div role="navigation"> should be <nav>.