79798322

Date: 2025-10-24 01:32:48
Score: 0.5
Natty:
Report link

My thanks to @TylerH for providing a link to a similar question here on Stack Overflow where I found my answer:

...modern browser seem to not complain if I use custom tag names, and then style those tags as if it where normal HTML tags, they behave like span elements, and like div elements, if I set display: block;...

Also, as @Mr Lister commented in said question:

So if you must use custom elements, use names starting with x-.

So (for the example I provided in my question) the following HTML and CSS will be valid (in modern browsers at least)!

<!-- HTML -->
<x-something>
    <!-- Content -->  
</x-something>

And:

/* CSS */

x-something {
    /* Styling */  
}
Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: student signup