Top
Best
New

Posted by todsacerdoti 17 hours ago

You can make up HTML tags(maurycyz.com)
460 points | 154 commentspage 6
singpolyma3 15 hours ago|
You can but you never ever should. Do not do this. Use the `class` attribute to provide extra context about the kind of data your tag represents, that is what it is for.
yawaramin 14 hours ago||
See https://news.ycombinator.com/item?id=46417607
lytedev 14 hours ago||
Why is this?
eviks 12 hours ago||
> Good luck trying to insert something inside of “article-heading” but after “article-quote” on the first try.

You don't need much, but an editor - collapse the sections to get the view as small as in the blog snippet, and then you'll have both opening and closing of the tag you're in highlighted, so you won't miss and won't need any luck

rascul 13 hours ago||
> Good luck trying to insert something inside of “article-heading” but after “article-quote” on the first try.

Indentation can help.

cubefox 11 hours ago||
I was forced to use this years ago because there is only a :nth-of-type selector, but no :nth-of-class. So whenever you need nth-of-class, switch to made-up tags and use nth-of-type. (A tag is a type.)
senfiaj 6 hours ago|
There is N-th child selector with filter, for example you can write :nth-child(3 of .red)

https://waspdev.com/articles/2025-06-29/css-features-web-dev...

cubefox 5 hours ago||
Cool! I guess this now also makes nth-of-type superfluous.
senfiaj 4 hours ago||
IMHO this also makes custom tags no longer very useful beyond custom HTML components (JS is also required for that). The standard tags provide good semantics, SEO and accessibility out of the box.
sitzkrieg 13 hours ago||
i'm very curious how screen readers would handle this. what a terrible idea
xigoi 11 hours ago|
Presumably exactly the same as a div/span.
devhouse 4 hours ago||
[dead]
coreyzzp 15 hours ago||
[dead]
T3RMINATED 6 hours ago||
[dead]
shevy-java 15 hours ago|
Hmmmm.

On the one hand I kind of want to use any random tag and have it work.

On the other hand ...

    <div class=main-article> # or <div class="main-article">

    versus

    <main-article>
I am not 100% sure, but I think I kind of prefer the div tag.

I understand that it is not the same semantically, but I am using div tags and p tags a LOT. I avoid the new HTML tags for more semantic meaning as this adds cognitive load to my brain. I'd rather confine myself to div and p tags though - it is just easier. And I use proper ids to infer additional information; it is not the same, but I kind of want to keep my HTML simple too. So I don't want to add 500 new custom HTML tags really. Even though I think having this as a FEATURE, can be useful.

alwillis 14 hours ago||
> I understand that it is not the same semantically, but I am using div tags and p tags a LOT. I avoid the new HTML tags for more semantic meaning as this adds cognitive load to my brain.

Serious question: are you saying that an entire webpage using only div and p tags is easier for you to grok than if the same webpage used standard tags like article and blockquote?

You're leaving so much functionality on the table. It also sounds like you're not using ARIA either, so your site is inaccessible to users of assistive technology.

You could use roles on your div tags to give a screen reader a fighting chance:

    <div class="header" role="banner">…</div>
    <div id="main" role="main">…</div>
    <div id="nav" role="navigation">…</div>
    <div id="footer" role="contentinfo">…</div>
alwillis 14 hours ago||
> I avoid the new HTML tags…

The HTML5 specification was released in 2014, so tags like article, section, header, figure, etc. have been around for more than a decade; they are not that new.