I'm curious if the spec actually says you can only wrap it with a div because I like to do semantic html and name my elements specific to my domain.
Custom-named elements are divs.
On The (2021)
51–60 of 138 posts
Re: On The <dl> (2021)
#52Earlier quoted context omitted.
Exactly! It cracks me up when people name-check "semantic elements" when it doesn't actually mean anything in that context. Accessibility software doesn't understand the semantics of your custom elements, so there is no benefit in that situation whatsoever. Maybe it's easier for you to read and edit in the future, but that's it. Somehow, people got convinced that elements are evil and should never be used no matter w…
I use it for readability and to express intention and meaning to the reader of my program. In the age of AI, perhaps, we've lost the need for that. But it was much appreciated in times before by those who came upon my code.
However, "semantic elements" became popular shortly after the push for the "semantic web" which was entirely based around making the web easier to process for machines. Many of the original sources talk about how it's easier to digest for humans too, but that's just a happy byproduct.
https://www.w3.org/DesignIssues/Semantic.html
https://www.lassila.org/publications/2001/SciAm.pdf
https://informationr.net/ir/7-4/paper134.html
https://jonchristopher.us/blog/a-semantic-breakdown-of-resta...
https://shapeshed.com/the-importance-of-semantic-markup/
Re: On The <dl> (2021)
#53Earlier quoted context omitted.
I don’t want to check what year html5 was standardized because I think it may be north of a decade ;)
> I think it may be north of a decade Nearly two!
Re: On The <dl> (2021)
#54> Prior to HTML5, this was called a definition list. This is because the was originally only intended to represent glossaries of terms and their definitions. TIL I’ve been naming it wrong for a decade.
TIL The name was changed from a definition list.
Re: On The <dl> (2021)
#55> Prior to HTML5, this was called a definition list. This is because the was originally only intended to represent glossaries of terms and their definitions. TIL I’ve been naming it wrong for a decade.
Re: On The <dl> (2021)
#56Earlier quoted context omitted.
Custom-named elements are divs.
They're not as you can see here[1] and here[2]. They both inherit from the HTMLElement interface but div is considered an HTMLDivElement which makes it distinct from a custom element. != [1] https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... [2] https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElem...
Re: On The <dl> (2021)
#57I'm curious if the spec actually says you can only wrap it with a div because I like to do semantic html and name my elements specific to my domain.
For example in XHTML you can use custom elements as table rows or cells (provided you give them the correct role and CSS display property). This is because XHTML does not modify the tree during parsing, unlike HTML which will hoist out custom element children of the table to the table's parent.
Re: On The <dl> (2021)
#58> This is incorrect: 1. has no corresponding ( viz. implicit) role, but can be given the role group, list, none or presentation https://w3c.github.io/html-aria/#el-dl >. 2. You’re only allowed to define aria-label on elements that have a compatible role, implicit or explicit https://w3c.github.io/html-aria/#docconformance-naming >. 3. aria-label is allowed on all but a handful of roles https://www.w3.org/TR/wai-aria-…
Re: On The <dl> (2021)
#59The tag seems to cover a subset of a broad semantic space, but doesn’t easily extend beyond adding another . I dunno, I guess I’m a caveman. If it looks right and works (including accessibility) then I figure I’m pursuing something that doesn’t matter a lot.
I need to learn more about web accessibility, but if you completely ignore it (and other sane practices) HTML looks really simple.
I think the design of HTML is just too much. There’s so many tags that don’t do much. It’s like w3c decided that any common thing people use in websites needs a tag. The end result is more and more tags…
Can anyone convince me otherwise? It screams design red-flags to me.
PS: I love the web and think it’s the best platform and future platform we have at the moment. It’s just quirky and loves not breaking old websites!
Re: On The <dl> (2021)
#60> This is incorrect: 1. has no corresponding ( viz. implicit) role, but can be given the role group, list, none or presentation https://w3c.github.io/html-aria/#el-dl >. 2. You’re only allowed to define aria-label on elements that have a compatible role, implicit or explicit https://w3c.github.io/html-aria/#docconformance-naming >. 3. aria-label is allowed on all but a handful of roles https://www.w3.org/TR/wai-aria-…
Wow I have never noticed that, thanks for the heads up! Out of curiosity, would you put `role="listitem"` on ` ` elements that wrap the ` ` && ` ` elements? It looks like `role="listitem"` is allowed on the ` ` element, but that doesn't feel like it would be accurate in the case where multiple ` ` elements are grouped together, and I'm not sure if that would mess with how the element is interpreted natively as as ter…