HTML Guide
“Garbage after </” means a stray less-than slash is followed by text that doesn’t form a valid end tag.
This happens when the parser encounters </
that isn’t the start of a proper end tag. Valid end tags must be </tagname>
where tagname
is a known HTML tag, case-insensitive, with no spaces before the closing >
. Common causes include typos (</ div>
), accidental text like </--
or </br>
, unescaped markup in text (you meant to show </div>
as text), or leftover characters after a correct end tag (e.g., </p>foo
where foo
wasn’t intended). If you need to display literal markup, escape it using character references: </div>
. Also ensure custom element names follow the hyphen rule (e.g., my-widget
) and that you don’t “close” void elements like br
, img
, or input
, which must not have end tags.
HTML Examples
Reproducing the issue
<!doctype html>
<html lang="en">
<head>
<title>Garbage after...</</title>
</head>
<body>
<p>This paragraph has a bad closing tag.</ p>
</body>
</html>
Fixing the issue
<!doctype html>
<html lang="en">
<head>
<title>Garbage after...</</title>
</head>
<body>
<p>Everything is fine now.</p>
</body>
</html>
Learn more: