5 ms·
When did that H1 behavior become part of the spec? I’ve been writing HTML since around ‘95 and don’t remember ever hearing of it before. I suspect it would co
by MBCook 2y ago
When did that H1 behavior become part of the spec?
I’ve been writing HTML since around ‘95 and don’t remember ever hearing of it before.
I suspect it would confuse the hell out of me if I had run into it. Sounds like a good thing to remove.
- jeroenhd 2y agoAFAIK it's one of those W3C versus WHATWG/browser vendor things. The spec has an algorithm, no browser actually implements it faithfully, and when browsers were still competing with each other nobody was going to break half the web to be spec compliant. The problem started decades ago (https://html5accessibility.com/stuff/2022/04/05/12-years-beyond-a-html-joke/ https://html5accessibility.com/stuff/2022/04/05/12-years-bey...).
- currysausage 2y agoIf I remember correctly, W3C’s XHTML2 working group wanted a generic <h> tag [1], and WHATWG, focused on evolving HTML in a backwards-compatible manner, repurposed <h1> as a context-dependent heading tag instead. [1] https://www.w3.org/TR/2010/NOTE-xhtml2-20101216/mod-structural.html#sec_8.5 https://www.w3.org/TR/2010/NOTE-xhtml2-20101216/mod-structur....
- zcorpan 2y agoIt has been in the spec since 2009: https://github.com/whatwg/html/commit/0ed655652d52f0ab068fcb2003ffcd1b6bbed249 https://github.com/whatwg/html/commit/0ed655652d52f0ab068fcb...
- _joel 2y agoPerhaps to address screen-readers and broken semantics of a page?
- GavinAnderegg 2y agoIt changed with the introduction of HTML5. It was one of those ideas that’s great for spec nerds, but flew in the face of previous standards compliance. It’s something I used on a lot of sites in the 2010s, but that I no longer have access to change. I’m betting this will make some old sites built by standards fiends look weird in spots, but not break things too badly. https://mattryall.net/blog/html-5-headings-and-sections https://mattryall.net/blog/html-5-headings-and-sections