Frage

I want to basically make a custom tag that doesn't need to be closed and apply css to it.

It shouldn't look like this:<customtag></customtag>.

It should look like this: <customtag> or <customtag/>.

War es hilfreich?

Lösung

Unless an element is already defined to be a void element in the HTML spec, they must have a closing tag.

Because of this, all custom web components must have a close tag. Additionally, custom elements must have a hyphen in their names to avoid conflicting with possible future tags.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top