5 ms·
> What has semantic HTML ever done for us? For us small things, like enable reader views. For people with disabilities, it lets them effectively use screen rea
by aylmao 4y ago
> What has semantic HTML ever done for us?
For us small things, like enable reader views. For people with disabilities, it lets them effectively use screen readers.
- cratermoon 4y agoThe accessibility aspect is huge and deserves more attention and kudos than it gets. Also, from a purely selfish aspect, I vastly prefer documents with at least a minimum of semantic organization, even if it's just header, footer, main, and meaningful heading levels. Without those, well, it's just a document full of undifferentiated text with various attributes to distinguish it visually or typographically, and usually inconsistently used. Is this piece of text styled "bold with fontsize 16" supposed to be a second or 3rd level header?
- imgabe 4y agoWhat stops screen readers from treating the <i> tag the same way they treat the <em> tag? If <em> functionally ends up doing the same thing that <i> did, what's the point?
- reaperducer 4y ago<i> for things that should be italic for visual reasons. For example, the titles of books. <em> for things that are emphasized, as in emphatic expressions within text. For example "You'll get nothing and you'll like it."
- gnubison 4y ago*<cite>
- Tomte 4y ago<cite> is also pure joy. From MDN: > It's worth noting that the W3C specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work's author. However, the WHATWG specification for <cite> says the opposite: that a person's name must never be included, under any circumstances.
- mananaysiempre 4y agoThere are also other things that are not emphasized, but require italics per typographical convention, <i lang="la">e.g.</i> foreign-language fragments.
- nirimda 4y agoIt doesn't have clear semantics. <cite> is basically used as "I want something in italics, and it is the title of something" rather than "here is a reference to a creative work". And it gives the lie to semantic markup: we only ever have semantic markup for things we can reasonably expect to be visually set-off. Something like a persons name or a cut-off phrase are never marked up semantically; there could be massive benefits from semantically attributing lists of city/state combinations in flowing text but it just doesn't happen. There's nothing more than semantically attributed visual markup, rather than being semantic markup, and this kind of renaming of <i> is just going overboard.
- yakubin 4y agoTIL. ~15 years ago I read "don't use <i>, use <em>", and so I did. Now it seems I need to go and change a bunch of <em>s to <i>s.
- stubish 4y agoA screen reader that did this would need to heuristically determine if the speech should be emphasized or not. Because you don't emphasize much of what is read when reading italicized text.
- masswerk 4y agoThe point being, if italics were already used to add emphasis and to separate an expression from the rest of the utterance, why was a dedicated tag required to express emphasis? (The heuristics only apply now, as there are two kinds of emphasis, which introduces some uncertainty of how things should be expressed. Moreover, as type styles have moved to CSS, there's a chance that a screen reader presentation may miss an intended separation of text.)
- Yoric 4y agoIn terms of typography, italics are also applied for titles, for quotes (in some contexts), for foreign expressions, sometimes for dialogs, and sometimes simply because they are easier to read. For a screen reader, you don't want to emphasize these use cases.
- masswerk 4y agoThey are still used to separate that expression, to make the expression stand out from the rest of the text. Surely, if I set a quote in italics, I mean this to be read in a distinctive voice by an aural presentation. (This is the entire point of separating it by a distinctive type style. I'm actually somewhat alarmed that this isn't the case.) Edit: There's a clear meaning to the use of distinctive type styles. I don't see an intrinsic value in pretending and that there is no such intended meaning and that there should be an artificial separation, rather than generalizing on presentation styles. Edit #2: In Antiqua, italics isn't just oblique text, it's an entirely different script. So what is the use case and the intended meaning of using a different script? Isn't this more conceptual than just using a fancy visual presentation style, which may be happily ignored in any other representation as there's probably no intended meaning to this?
- 4y ago
- bobajeff 4y agoRelevant: https://www.stefanjudis.com/today-i-learned/em-and-strong-are-not-be-announced-by-screen-readers/ https://www.stefanjudis.com/today-i-learned/em-and-strong-ar...
- csande17 4y agoModern web developers don't use semantic HTML for screen reader support. They manually apply screen reader interpretation data the same way they manually apply Tailwind styles to every element. (That's what WAI-ARIA is for, most notably the "role" attribute.)
- eurasiantiger 4y agoMost of the new HTML5 elements (main, aside, article, section, nav…) have an implicit ARIA role, no need to add one manually.
- csande17 4y agoA lot of the old ones do too, but elements not named <div> are an elitist conspiracy to prevent people from becoming web developers.
- maxwelljoslyn 4y agoSounds like a rat's nest of fragility. :(