</>
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

Cloudways · Managed Cloud Hosting

Fix this HTML error, then deploy on Cloudways managed cloud (AWS, GCP, DigitalOcean). 20% off 3 months with code VALIDATEHTML.

Start free trial

Related HTML Errors

← View all HTML errors