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.
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
<!-- 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">
<!-- 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?
What replaces <a name> for jump links?
Is width on an <img> deprecated too?
Check Your HTML Now
Our validator detects this error automatically and shows the exact line number.
Open HTML ValidatorRelated HTML Errors
Deprecated HTML Elements
Deprecated HTML elements like center, font, and marquee signal outdated code. See the full list and the modern CSS replacements that fix every warning.
Invalid Attribute Value
target="", type="Submit", loading="true": attributes with a fixed list of allowed values fail silently when the value is wrong. Learn where the traps are.
Excessive Inline Styles
Excessive inline styles bloat your HTML, fight specificity, and block reuse. Learn why they hurt maintainability and when to use external CSS classes instead.