← Back to context

Comment by shermantanktop

1 day ago

Oh that’s great. It’s an opinionated view that focused strictly on the behavior of the tags wrt layout and appearance.

I’ve noticed that discussions of semantic meaning of tags often contain the word “feel.” Nothing wrong with that, taste matters, but it does point to the non-functional goals that are being pursued when people disagree.

<ol> vs <ul> - they are both ordered, because markup is ordered. One gets decorated differently than the other by default. Is the difference semantic or typographical?

A <ul> is a list of things whose order makes no difference to its meaning. Rearranging a <ul> would change the presentation, not the information. Rearranging an <ol> would change both.

  <ul> Players
    <li> Alice
    <li> Bob
    <li> Carol
  </ul>

  <ol> Leaderboard
    <li> Bob
    <li> Alice
    <li> Carol
  </ol>

  • Exactly. “Unordered” implies “reordering doesn’t change meaning.” And yet that’s already implicit in the bullets (vs numbers).

    So is it a decoration hint? Or is it actually semantic? And what system is interpreting the semantics rather than the visual presentation?

    • HyperText Markup Language is semantic. You're marking up a document to show what information it contains, where it contains it, and how it relates to other documents or information. Reading markup causes browsers to display things, but that's incidental.

      In theory.

      In practice, no one cares about semantics and the choice of tags is based on how a target set of browsers happens to display them.

      Your question about who interprets markup is exactly right. In theory, you have no idea. Maybe it's a browser, maybe it's assistive software, maybe it's a browser printing, maybe it's some custom knowledge base with different views of documents for different users. In theory, you're supporting all of that by only marking up semantics and allowing the consumer to interpret them, because there isn't one right answer.

      In practice, your client is Chrome.

      In theory, that's irrelevant because you're using CSS to style semantic markup so it works in Chrome and still makes sense to other clients.

      In practice, you're writing a web application, using a framework, and nothing in the stack wants you to do that.

      1 reply →

  • Too late to edit now, but I should mention putting titles in a list like that isn't valid. It's just to shorten the example.