Discussion

Ask HN: Who is consuming all these semantic HTML tags?

HTML5 introduced a bunch of "semantic" HTML tags to markup content. To this day I still haven't figured out what are the practical implications of using them at all, so I've come here ask.

What I know: screen readers may announce/make use of main/article/section/aside/nav/search/del/ins because they have default ARIA settings.

What I want to know: who ELSE consumes these tags and for what, and who is consuming:

  1. <figure> and <figcaption>
  2. <small>  
  3. <strong> and <em>  
  4. <del> and <ins>  
  5. <samp> and <kbd> 
  6. <small>  
  7. <abbr>  
  8. <cite> and the cite attribute of <blockquote>  
  9. <mark>  
  10. <hgroup>
Because if nobody is consuming these, it's hard to see a point in bothering with all these tags at all. I know for a fact Wordpress and many other CMS's just wrap every image in a <figure> which goes against the spec, so I assume whoever tried to consume that to make figures go into a sidebar or something probably just gave up because the markup of most the web is wrong, but what about the rest? Because, I don't know if you've seen this, but the spec[1] says you should mark up a menu with this atrocity:

<kbd><kbd><samp>File</samp></kbd>|<kbd><samp>Eat Apple...</samp></kbd></kbd>

And I have no idea why would anyone bother with such complicated markup instead of just using <code>, because... if nobody would write code like this, why would anyone write a program to read code like this that nobody is writing?

I think I've read that <article> should work like an ATOM feed, but is anyone parsing <article> as if they were feed items? I mean, as a general-purpose solution. If it's done for a single site that's not really markup-level semantics, that's like site-level semantics, you could have just used a selector based on the class that site used for its articles, for example. Is that all this is? A shorthand for class="..."?

[1] https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-kbd-element

28 points AlienRobot 2 years ago 47 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton