Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Custom html-tags or elements without hyphens in 2023

The fukcer disabling this question does not get pussy and is a fat cow sorry for his life

It seems like the last question about this was asked in 2018 and the web development evoluted a lot since 2018.

I want to create custom html tags to markup my layout like this:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<html><body>
<whynot>obviously yes</whynot>
<mycustomname>Hello world</mycustomname>
<anotherone>It works</anotherone >
</body></html>

According to old answers, there must be an hyphen in the middle or at the end but never at the beginning. But some others said that you can use any tag name or element name without hyphens.

The thing is that Safari, Chrome and maybe all web browsers display these custom names without hyphens.

The question in 2023:
Is it ok to use these kind of tag-names/element-names without hyphens in 2023? Or we never advanced in that matter ?

>Solution :

Yes, they should have a hyphen.

The main reason from your point of view would probably be compatibility going forward.

See for example:

They contain a hyphen, used for namespacing and to ensure forward compatibility (since no elements will be added to HTML, SVG, or MathML with hyphen-containing local names in the future).

From the spec

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading