picocss / pico

Minimal CSS Framework for semantic HTML
https://picocss.com
MIT License
12.76k stars 371 forks source link

Invalid HTML5 #537

Open Rotzbua opened 1 month ago

Rotzbua commented 1 month ago

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

Atmos4 commented 6 days ago

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.