hail2u / html-best-practices

For writing maintainable and scalable HTML documents
4.11k stars 439 forks source link

"Don’t mix empty element format" could be "always self close empty elements" #128

Closed vinilneves closed 1 year ago

vinilneves commented 1 year ago

"Don’t mix empty element format" could be "always self close empty elements"

Instead of

Bad:

<img alt="HTML Best Practices" src="/img/logo.png">
<hr />

Good:

<img alt="HTML Best Practices" src="/img/logo.png">
<hr>

Could be

Bad:

<img alt="HTML Best Practices" src="/img/logo.png">
<hr />

Good:

<img alt="HTML Best Practices" src="/img/logo.png" />
<hr />

PS. Also use html type for code blocks

hail2u commented 1 year ago

No. Just don’t mix. Omitting slash is completely valid.