News for hackers. Stuff that matters.
Re:A Blog Post with Every HTML Element by dsego on Sunday August 13, 2023 @09:45AM (#37109990)
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>
Re:A Blog Post with Every HTML Element by extra88 on Sunday August 13, 2023 @11:17AM (#37110771)
You 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.
Re:A Blog Post with Every HTML Element by runarberg on Sunday August 13, 2023 @11:28AM (#37110867)
They 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-ou...

Re:A Blog Post with Every HTML Element by throwaway18533 on Sunday August 13, 2023 @07:25PM (#37115649)
XHTML 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-structur...