💡 Tip: Login now to track your course progress and unlock your downloadable certificates instantly!

Deprecated Tags

As HTML evolved, many tags that were once common became deprecated — meaning they are no longer recommended for use in modern web development.
Deprecated tags may still work in some browsers for backward compatibility, but they are not supported in HTML5 and can cause SEO and accessibility issues.

What Does “Deprecated” Mean?

A deprecated tag is an old HTML element that has been replaced by newer, more efficient, or semantic alternatives.
While browsers may still render them, they could be removed in future updates, so using them is not a best practice.

Example (Deprecated):

<center>
  <h2>This is centered text</h2>
</center>

Correct Modern Alternative:

<h2 style="text-align: center;">This is centered text</h2>

Common Deprecated Tags and Their Alternatives

Deprecated TagPurpose (Old)Modern Alternative
<acronym>Defines an acronym<abbr>
<applet>Embeds a Java applet<object> or <embed>
<basefont>Sets default font for a pageUse CSS (font-family, font-size)
<big>Displays large textUse CSS (font-size)
<center>Centers contentCSS (text-align: center;)
<dir>Creates a directory list<ul>
<font>Sets font size, color, faceCSS (font-family, color, font-size)
<frame>, <frameset>, <noframes>Divides window into frames<iframe> or modern layouts (CSS Grid/Flexbox)
<isindex>Creates a search field<input type="search">
<menuitem>Defines a command menu item<button> or <li>
<s>Strikethrough text<del> (for older docs)
<strike>Draws a line through text<del> or CSS (text-decoration: line-through;)
<tt>Monospaced (teletype) text<code> or <pre>
<u>Underlined textCSS (text-decoration: underline;)
<xmp>Displays preformatted text<pre> or <code>

Deprecated Attributes (Also Avoid These)

AttributeDeprecated FromModern Replacement
align<p>, <div>, <img>CSS (text-align, float)
bgcolor<body>, <table>CSS (background-color)
border<table>CSS (border)
height, width<img>, <table>CSS (width, height)
hspace, vspace<img>CSS (margin, padding)
nowrap<td>CSS (white-space: nowrap;)
valign<td>CSS (vertical-align)

Why Avoid Deprecated Tags

  • ❌ Poor accessibility and SEO
  • ❌ Non-responsive layouts
  • ❌ Reduced browser compatibility
  • Use CSS and semantic HTML tags instead
  • ✅ Cleaner, modern, maintainable code

Example: Updating Old HTML

Deprecated HTML:

<body bgcolor="lightblue">
  <center>
    <font color="red" size="5">Welcome to My Page</font>
  </center>
</body>

Modern HTML5 Version:

<body style="background-color: lightblue;">
  <h1 style="text-align: center; color: red; font-size: 2em;">Welcome to My Page</h1>
</body>

Tools to Check Deprecated Tags

You can check your HTML for deprecated elements using:

  • W3C Markup Validation Service: validator.w3.org
  • HTMLHint (browser plugin or npm)
  • VS Code extensions like HTMLHint or WebLint

Summary

ConceptDescription
Deprecated tagsNo longer recommended for use
Why avoid themPoor SEO, accessibility, and modern compatibility
Modern practiceUse CSS and semantic HTML
Validation toolsW3C Validator, HTMLHint

Conclusion

Deprecated tags are remnants of early HTML versions.
Modern web design emphasizes separation of content and style, achieved through semantic HTML and CSS.
By avoiding deprecated tags and using current standards, you create websites that are cleaner, future-proof, and search-friendly.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend