</>
ValidateHTML

Deprecated HTML Attribute

HTML5 removed the presentational attributes that CSS replaced, and a handful of others that duplicated better mechanisms. Browsers still honour most of them for compatibility, so nothing visibly breaks, and that is exactly why they survive in codebases for years after being removed from the standard.

Find this error in your own code. Paste your HTML or enter a URL, free and instant.Open the validator
19.3%
of sites tested

How common is this error?

We ran this validator over the home page of the Tranco top 5,000 websites in August 2026. 512 of the 2,655 sites we could reach hit it. That makes it the 10th most common HTML problem we found, across 6,474 occurrences. See the full study.

Most frequent wording: Attribute "name" is deprecated on <a> element

Why It Matters

On 19% of sites, most often as name on an <a> used as a jump target. Deprecated attributes are not rendering bugs; they are a signal that a template predates HTML5 and has never been revisited, and they usually travel with other obsolete markup.

Common Causes

  • Markup written for HTML 4 or XHTML and carried forward through redesigns.
  • WYSIWYG editors and email-oriented templates that still emit presentational attributes.
  • Table markup copied from a period when layout tables were normal.

Code Examples

Invalid
<!-- Anchor target the HTML 4 way -->
<a name="section-2"></a>

<!-- Presentation in markup -->
<table border="1" cellpadding="5">
<td align="center" bgcolor="#eee">Cell</td>
<img src="a.jpg" alt="A" hspace="10" border="0">
Valid
<!-- id works as a jump target and as a JavaScript hook -->
<h2 id="section-2">Section 2</h2>

<table class="data-table">
<td class="cell-centered">Cell</td>
<img src="a.jpg" alt="A" class="inline-image">

How to Fix

  • 1Replace <a name="x"> with an id on the element the link actually points at. Linking to a heading is better than to an empty anchor before it: screen readers move focus to real content.
  • 2Move align, valign, bgcolor, border, cellpadding, cellspacing, hspace and vspace into CSS. They are presentation, and that is the whole reason they were removed.
  • 3Keep width and height on <img>, <video> and <canvas>. Those are not deprecated, and they prevent layout shift.
  • 4Search the codebase for the attribute rather than fixing pages one at a time; deprecated attributes arrive by template, not by accident.

Frequently Asked Questions

Will a deprecated attribute stop working?
Unlikely: browsers keep them for compatibility with the existing web, and removing support would break millions of pages. The reason to fix them is maintainability and validity, not a looming breakage.
What replaces <a name> for jump links?
An id on the target element. Put it on the heading itself, as in <h2 id="pricing">, so that following #pricing lands focus on real content rather than an empty anchor placed just before it.
Is width on an <img> deprecated too?
No. width and height on <img>, <video>, <canvas> and <iframe> are current and recommended: browsers use them to reserve space and avoid layout shift while the media loads. It is the presentational attributes like border and hspace that went away.

Check Your HTML Now

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

Open HTML Validator

Related HTML Errors

← View all HTML errors