4 ms·
I can see the value of almost all of those recommendations but I don't understand the value of using the correct header sequence or tagging subheaders. I don't
by msl09 10y ago
I can see the value of almost all of those recommendations but I don't understand the value of using the correct header sequence or tagging subheaders. I don't see anything in the linked W3C article that explains why I should use one idiom over another.
- YngwieMalware 10y agoA 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.
- FroshKiller 10y agoA simpler way to say "more semantically correct" is "correct." Please don't trivialize the importance of semantics. Proper semantic representation makes documents more accessible.
- cloverich 10y agoI 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?
- throwanem 10y agoTake a look at http://accessiblehtmlheadings.com/ 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.
- FroshKiller 10y agoSorry, I should've provided a reference for you. The link throwanem posted is a good introduction with an interactive demonstration.
- rocky1138 10y agoDo you have any documentation for this? This part of the article is what stood out for me, too.
- throwanem 10y agoThe relevant section of the standard: https://www.w3.org/TR/html5/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements https://www.w3.org/TR/html5/sections.html#the-h1,-h2,-h3,-h4... - https://www.w3.org/TR/html5/sections.html#headings-and-sections 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/ http://accessiblehtmlheadings.com/ .
- FroshKiller 10y agoSorry again, I should've provided a reference for you. The link throwanem posted is very good.
- nommm-nommm 10y agoI think it also make the HTML easier to read.
- joshkpeterson 10y agoIsn't it because of the way screenreaders prioritize which headings to read based on the #? Eg read H1, then H2's, etc.
- throwanem 10y agoConsider automated TOC generation. If you use the h* tags as they're designed to be used, it's trivial to produce a table of contents for even a very complex document by simply extracting and numbering the headers, and hyperlinking it is almost as easy. Consider screen readers and other accessibility technologies. If you use the h* tags as they're designed to be used, it is very easy for someone who cannot see your document to navigate within it by moving from header to header, and to navigate within sections by moving from subheader to subheader. These are two examples of automatically extracting semantic information from an HTML document in order to enable new ways of interacting with its content. Such methods can only work if the semantic information is there to begin with. Using standard header tags in the standard fashion is a good, simple way to include such information. It is not the only way, but it is by far the most widely understood way, and you do both yourself and your readers a favor by not requiring the use of special-case exceptions to parse your content. Of course, if your purpose is not to publish content, then this may not be a major concern for you. Perhaps you're building one of those modern-style marketing sites where the presentation is excruciatingly visual, the standard interaction methods are unnecessarily hijacked, and the content is minimally existent. In that case, I wouldn't worry so hard about it. But if you're publishing something that's got some meat to it, this is a standard worth following.
- steveax 10y agoAlso, WRT screen reader users, like sighted users, they often scan the document by skimming the headings, links, etc. Screen reading software will pull these out into separately scannable lists available for the user to skim through outside of the context of the surrounding content. Having out of order heading creates a document outline that is confusing. This is why it's also important to write good linked text as scanning 20 links that all say "read more" is useless.
- nerdponx 10y agoI know this is tangential, but Pandoc and Markdown in general benefit greatly from it.
- squeaky-clean 10y agoIt's helpful to other computers reading your website. This can be anything from a screen reader to a search engine crawler to a script like Readability for extracting the readable sections of a website to a document.
- deleted 10y ago[deleted]