Live data from Hacker News

Every HTML Element

iamwillwang.com

41–50 of 136 posts

Re: Every HTML Element

#41

Most people insist on only using one element, which is the element of last resort, according to MDN. This is our friend, the . The only use case I have for is in a details/summary where there is no CSS to select the contents of a element, excluding the . Does this mean I use instead of , as a 'direct replacement'? Nope. When using CSS grid, there is no need for wrappers around everything. I do like to use the full HT…

This is a great approach. Just to add to it, you can also use custom elements in lieu of classes, such as:

...

Any tag with a hyphen is considered a custom element, which is completely valid HTML -- even without defining the element in JS.

This gives you a more descriptive `div`, and then instead of classes like `product-primary`, you can use semantic attributes, like ``. In combination with CSS nesting, you can get some great looking HTML and CSS with minimal markup/visual noise and no build step.

Re: Every HTML Element

#42
post #34

Earlier quoted context omitted.

It means if you use it then it’ll work fine but younger people will frown at you.

unlike the tag where younger people will just stare at you in a creepy extended unblinking gaze. it would be so much more satisfying if it still made them blink.

I absolutely need to write a polyfill for that.

Re: Every HTML Element

#45
post #36
post #25

Earlier quoted context omitted.

hgroup is considered deprecated in HTML5 though, whatever that actually means.

Is it? I don't see any such warning or notice on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hg... . It's still listed here: https://www.w3.org/TR/2011/WD-html5-20110405/sections.html#t... . Perhaps it was re-added?

Hmmm you are right! This discussion explains that a bit https://stackoverflow.com/questions/15808330/hgroup-element-... looks like it was going to be removed, but WHATWG ended up keeping it.

Re: Every HTML Element

#47

First I've ever heard of hgroup. Subheadings are one of those little things I've wondered about the proper semantics for a million times and always end up doing something slightly different on the fly.

> First I've ever heard of hgroup.

was officially added to the HTML spec in 2018 [1]

It was deprecated in the W3C spec but not from the WHATWG spec, before they were merged.

[1]: https://html.spec.whatwg.org/#the-hgroup-element

Re: Every HTML Element

#48
post #25

First I've ever heard of hgroup. Subheadings are one of those little things I've wondered about the proper semantics for a million times and always end up doing something slightly different on the fly.

hgroup is considered deprecated in HTML5 though, whatever that actually means.

> hgroup is considered deprecated in HTML5 though, whatever that actually means.

It was only deprecated in the W3C specification, not the WHATWG specification.

But now it's back in good standing: https://www.tpgi.com/subheadings-subtitles-alternative-title...

Re: Every HTML Element

#49
Disappointed to see or merely mentioned but not used on that page, seemed like a serious omission.

Based on my tests just now, no longer blinks in today’s browsers but still scrolls happily.

Re: Every HTML Element

#50
The element says "This is a modal dialog displayed using just HTML." but that's a bit misleading because the dialog opens using JavaScript `document.getElementById('my-dialog').showModal()` in the onclick attribute of the relevant button.
Post reply on HN