logoalt Hacker News

jakelazaroffyesterday at 3:49 PM1 replyview on HN

How does the slash make it clearer? It's totally inert, so if you try to do the same thing with a non-void tag the results will not be what you expect!


Replies

onion2kyesterday at 3:59 PM

It indicates that the content that follows is not inside of the tag without the reader needing to remember how HTML works. Tags should have either a self-closing slash, or a closing tag.

The third way of a bare tag is where the confusion comes from.

show 1 reply