Top
Best
New

Posted by todsacerdoti 12/29/2025

You can make up HTML tags(maurycyz.com)
584 points | 190 commentspage 7
singpolyma3 12/29/2025|
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 12/29/2025||
See https://news.ycombinator.com/item?id=46417607
lytedev 12/29/2025||
Why is this?
shevy-java 12/29/2025|
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 12/29/2025||
> 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 12/29/2025||
> 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.