</>
ValidateHTML

Unclosed HTML Tag

An unclosed tag occurs when an opening HTML tag like <div>, <p>, or <span> is missing its corresponding closing tag. Browsers try to auto-close tags, but the results are unpredictable — content can be swallowed, layouts break, and styles bleed into wrong sections.

Why It Matters

Unclosed tags are one of the most common causes of broken layouts. A single unclosed <div> can shift your entire page structure. Screen readers also depend on proper tag closure to navigate content correctly.

Code Examples

❌ Invalid
<div class="card">
  <h2>Title</h2>
  <p>Description
</div>
✓ Valid
<div class="card">
  <h2>Title</h2>
  <p>Description</p>
</div>

How to Fix

  • 1Use an HTML validator to find the exact line where the unclosed tag starts.
  • 2Work from the innermost unclosed tag outward — fix nested issues first.
  • 3Use an editor with bracket matching (VS Code highlights matching tags).
  • 4Self-closing tags like <img>, <br>, <input>, and <hr> do not need a closing tag.

Check Your HTML Now

Our validator detects this error automatically and shows the exact line number.

Open HTML Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated HTML on reliable hosting.

Get 80% Off Hosting →

Related HTML Errors

← View all HTML errors