MyInternships.in

HTML Basics

HTML Deprecated Tags

Some old HTML tags still work in browsers but should no longer be used. This page lists the main deprecated tags and shows the modern replacements you should use instead.


What are Deprecated Tags?

A deprecated tag is one that HTML5 has removed from the standard. Many still render because browsers keep old features for backward compatibility, but they are considered obsolete and may stop working in the future.

Most deprecated tags handled styling, such as <font> and <center>. The modern approach separates content from presentation: HTML describes the content, and CSS handles all the styling.

Deprecated Tags and Their Replacements

DeprecatedDid whatUse instead
<font>Set text color, size, faceCSS color, font-size, font-family
<center>Centred contentCSS text-align or margin:auto
<big>Larger textCSS font-size
<strike>Strikethrough text<del> or CSS text-decoration
<marquee>Scrolling textCSS animation
<frame>/<frameset>Split the windowCSS layout or <iframe>
<tt>Monospace text<code> or CSS font-family

Example: Old Way vs Modern Way

The deprecated approach (avoid this)
Example
<!-- Old, deprecated -->
<center>
  <font color="red" size="5" face="Arial">Old styling</font>
</center>
The modern, correct approach
Example
<!DOCTYPE html>
<html>
<body>
  <p style="text-align:center; color:red; font-size:1.5rem; font-family:Arial;">
    Modern styling with CSS
  </p>
</body>
</html>

More Examples

Replacing <center> with CSS
Example
<!-- Centre a block with margin auto -->
<div style="width:200px; margin:0 auto; background:#cfe2ff; text-align:center; padding:10px;">
  Centred box
</div>
Replacing <strike> with <del> or CSS
Example
<p>Was <del>$99</del>, now <span style="text-decoration:line-through;">$79</span> — pay $49.</p>
⚠️

Never use deprecated tags in new projects. They can be dropped by browsers, hurt accessibility, and signal outdated code to other developers.

💡

The golden rule: HTML for content and structure, CSS for all presentation. If a tag only changes how something looks, there is a CSS property for it.

Key Takeaways

  • Deprecated tags are obsolete in HTML5 but may still render.
  • Most were for styling, like <font> and <center>.
  • Replace them with CSS or semantic elements such as <del>.
  • Keep content in HTML and all presentation in CSS.

Related HTML Topics

Keep learning with these closely related tutorials.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships