4 ms·
One of many things that irk me, like why limit to 1-6 instead of allowing an attribute for arbitrary size, eg <h level=15>
by dsego 3y ago
One of many things that irk me, like why limit to 1-6 instead of allowing an attribute for arbitrary size, eg <h level=15>
- extra88 3y agoYou can go beyond 6 with ARIA, e.g. role="heading" aria-level="7". I don't know what the limit is. I think it's challenging to find distinct visual styles for many heading levels.
- runarberg 3y agoThey tried to make the the explicit number irrelevant and infer the level by the number of nested sections, so instead of: <article> <h1>Title</h1> <section> <h2>Section</h2> <section> <h3>Sub Section</h3> <section> <h4>Sub Sub Section</h4> </section> </section> </section> </article> You could simply use <h2> repeatedly and keep the semantic structure of the former. <article> <h1>Title</h1> <section> <h2>Section</h2> <section> <h2>Sub Section</h2> <section> <h2>Sub Sub Section</h2> </section> </section> </section> </article> However this was never implemented by any browser or screen reader and was finally dropped from the standard. http://html5doctor.com/computer-says-no-to-html5-document-outline/ http://html5doctor.com/computer-says-no-to-html5-document-ou...
- throwaway18533 3y agoXHTML 2 did that. It only had a <h> tag that was depending on <section> to define the level. In fact your code would be exactly like xhtml2, if you replaced <h1-6> with <h> I understand why some people might not like xhtml2, but it did have some good ideas for creating a semantic document Example: https://www.w3.org/TR/2010/NOTE-xhtml2-20101216/mod-structural.html#s_structuralmodule https://www.w3.org/TR/2010/NOTE-xhtml2-20101216/mod-structur...