Hacker News new | ask | show | jobs
by YngwieMalware 3587 days ago
A lot of it is semantics. A bunch of HTML5 is semantic vs. actually having different behavior. <header> behaves no differently than <div id="header"> but is more semantically correct.
3 comments

A simpler way to say "more semantically correct" is "correct." Please don't trivialize the importance of semantics. Proper semantic representation makes documents more accessible.
I don't find the header, article, section, etc tags to be sufficiently clear that they are always used in the same way by different people. But maybe I'm missing something -- how do they improve accessibility?
Take a look at http://accessiblehtmlheadings.com/ for a pretty solid introduction. The tl;dr: is that, used properly, they enable screen readers and similar to identify document structure and make it more easily navigable.
Sorry, I should've provided a reference for you. The link throwanem posted is a good introduction with an interactive demonstration.
Do you have any documentation for this? This part of the article is what stood out for me, too.
The relevant section of the standard: https://www.w3.org/TR/html5/sections.html#the-h1,-h2,-h3,-h4... - https://www.w3.org/TR/html5/sections.html#headings-and-secti... expands on this somewhat further.

For a considerably more detailed treatment with special attention to concerns around accessibility and some information on other document elements with similar significance, take a look at http://accessiblehtmlheadings.com/ .

I see. For the longest time I've been using <h2> as a sub-title. I guess I'll have to stop that. Thanks!
You are most welcome!
Sorry again, I should've provided a reference for you. The link throwanem posted is very good.
I think it also make the HTML easier to read.