pico icon indicating copy to clipboard operation
pico copied to clipboard

Invalid HTML5

Open Rotzbua opened this issue 9 months ago • 1 comments

Since this useful framework relies on native HTML, it would be good to use formally correct HTML in the documentation and examples.

The following facts are relatively unknown or ignored:

In HTML, a void element must not have an end tag. For example, `<input type="text"></input>` is invalid HTML.
Self-closing tags (<tag />) do not exist in HTML.

Source: https://developer.mozilla.org/en-US/docs/Glossary/Void_element

Rotzbua avatar May 07 '24 20:05 Rotzbua

It's all over the documentation. Void elements seem to always be self closing in the docs.

I assume the reason for this is that void elements are not valid XML syntax, so if you use a XML templating language like JSX / TSX, then this is how things should look :D

I don't think it confuses anyone. Browsers won't break because of this, so you just have to be aware that in html certain elements are void elements. The rest is just syntax preference.

Atmos4 avatar Jun 25 '24 09:06 Atmos4