Click any row in the report. The cursor lands on the faulty line, with the line selected. Red and amber numbers in the gutter mark the same lines, so a long template shows where the trouble clusters before you read a single message.
What the browser builds from a broken paste
Here is a paragraph with a div inside. Left, the source. Right, the tree a browser builds from the source, as DevTools shows under Elements.
<p class="lead">Three fixes went live.
<div class="note">Staging moved.</div>
</p>
<p class="lead">Three fixes went live.
</p>
<div class="note">Staging moved.</div>
<p></p>
A p holds phrasing content only. The parser ends the paragraph the moment <div> opens. The later </p> has nothing left to close, so the parser builds a new, empty paragraph from the tag.
Two effects follow. Styles on .lead stop before the note. An empty paragraph with its own top and bottom margin appears under the note, and the gap looks like a CSS bug. The console stays silent.
The checker reads your source, not the repaired tree. The report names line 3, the stray </p>, and points back to the div on line 2 as the cause.
Rules the checker applies
Two levels. An error breaks a parsing rule or a nesting rule from the HTML spec. Browsers repair errors, and the DOM ends up different from your file. A warning marks obsolete markup, a likely typo, or a missing document detail. Warnings change nothing about how the page parses.
| Rule | Level | Trips on | What the browser does |
|---|---|---|---|
| Element never closed | Error | <section> with no end tag | Closes the section at the end of the file. Every later block lands inside. |
| End tag skips an open child | Error | <li><span>text</li> | Closes the span at the </li>. Span styles bleed to there. |
| Stray end tag | Error | </div> with no open div | Drops the tag. A stray </p> turns into an empty paragraph. |
| Block inside a paragraph | Error | <p> holding a div, ul, table, or heading, reported at the </p> | Ends the paragraph before the block. |
| Link inside a link | Error | <a> opened before the first </a> | Ends the outer link at the inner one. |
| Interactive inside a link or button | Error | A button, input, select, or textarea inside <a> | Keeps both. Click targets and tab order differ per browser. |
| Heading inside a heading | Error | <h2><h3> | Closes the outer heading first. |
| End tag on a void element | Error | </br>, </img>, </input> | Reads </br> as a second line break. Drops the rest. |
| Duplicate attribute | Error | class="lead" class="intro" | Keeps the first value. The intro class never applies. |
| Duplicate or broken id | Error | The same id twice, an empty id, an id with a space | getElementById and #top links stop at the first match. |
| img with no alt or src | Error | <img src="logo.png"> | Shows the image. Screen readers read the file name aloud. |
| Unclosed comment, quote, script, or tag | Error | <!-- todo with no --> | Swallows the rest of the file into the comment or value. |
| Missing doctype or title | Error | Full documents only | No doctype means quirks mode. Box sizing and table fonts change. |
| Slash on a normal element | Warning | <div/> | Ignores the slash. The div stays open. |
| Obsolete element or attribute | Warning | <center>, <font>, bgcolor, align | Still renders. The report names the CSS replacement. |
| Unknown element | Warning | <buton>, <titel> | Treats the tag as a plain inline box. Names with a hyphen pass as custom elements. |
| Misplaced list, row, or option | Warning | <li> in a div, <td> outside a row | Builds the missing parent or moves the element. |
| Content inside head | Warning | A div before <body> | Ends the head early. Meta tags after the div land in the body. |
| label pointing nowhere | Warning | for="email" with no matching id | A click on the label focuses nothing. |
| No lang, no charset | Warning | Full documents only | Screen readers guess the language. Encoding falls back to a sniff. |
Optional end tags count as valid. <li>one<li>two, a paragraph closed by the next paragraph, and table cells with no </td> all pass, because the spec allows them. A slash on a void element such as <br/> also passes.
The sample, fault by fault
Load sample fills the box with a release-notes page for toolexe.com, 29 lines long. Every fault below sits there on purpose. Run the check, then match the report against this list.
- Line 2The html tag has no lang. A warning, since the page still parses.
- Line 9The logo img has no alt. A screen reader announces "logo dot png" inside a link, which tells nobody where the link goes. Here the fix is
alt="Toolexe home", not an empty alt, because the image is the only content of the link. - Line 11
id="top"on main repeats the header id from line 8. The#toplink on line 19 scrolls to the header. - Line 13Two class attributes. The paragraph gets lead, never intro.
- Line 15The stray
</p>from the demo above, caused by the div on line 14. - Line 18The muted span never closes. The report anchors on the span, then names the
</li>where the browser cuts the span off. - Line 19A link to
#topsits inside the link to the beautifier. The second</a>closes nothing in the browser tree. - Line 21Two faults on one line. The center tag is obsolete, a warning. The
</br>is an error, and the browser renders the pair as two line breaks. - Line 23The label points at
email. The input id iswork-email. The name attribute matches, so the form posts fine, but a click on the label does nothing. The name never counts for a label.
Fix line 14 first. Move the note outside the paragraph and the error on line 15 disappears with the fix. One early fault often produces the later ones, so the report sorts by line and the top row deserves the first look.
Full document or fragment
A fragment is a Blade partial, a CMS body field, an email block, a component template. A fragment has no doctype, title, lang, or charset, and should not. Fragment mode skips those four rules.
Auto detect switches to full document once the paste holds a doctype or an html tag. Pick a mode by hand when auto guesses wrong, for example a partial with an html tag inside a code sample.
Where this checker stops
The rules above run against the source in a single pass. A few classes of fault sit outside the pass.
- Attribute values go unchecked. A broken srcset, a bad date in datetime, an input type of "emial", a malformed URL in href. All pass.
- Content model coverage is partial. Common nesting faults are covered. A div inside a span, a figcaption outside a figure, or two main elements pass here.
- No ARIA rules. A role on the wrong element or an aria-labelledby pointing at a missing id stays quiet. Run an accessibility audit for those.
- Script and style bodies are skipped. A syntax error inside a script block stays invisible. The checker only finds where the block ends.
- Character references go unchecked.
©with no semicolon passes. - Pastes over 2 MB are refused. Split a large export by section.
- Template syntax is read as text. Curly-brace output and directives pass. Component tags with no hyphen, such as
<Card>, show as unknown elements. Check the rendered HTML from View Source instead.
Before a launch, run the rendered page through the W3C Nu validator. Nu applies the full spec, attribute grammars included. Expect a slower round trip and a longer report. This page suits the edit loop: paste, fix line 14, check again.
For nesting faults spread across hundreds of lines, run the markup through the HTML beautifier first. Indentation drifts right at an unclosed element, so the fault becomes visible by eye. Then come back here for the line number.