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
| Deprecated | Did what | Use instead |
|---|---|---|
| <font> | Set text color, size, face | CSS color, font-size, font-family |
| <center> | Centred content | CSS text-align or margin:auto |
| <big> | Larger text | CSS font-size |
| <strike> | Strikethrough text | <del> or CSS text-decoration |
| <marquee> | Scrolling text | CSS animation |
| <frame>/<frameset> | Split the window | CSS layout or <iframe> |
| <tt> | Monospace text | <code> or CSS font-family |
Example: Old Way vs Modern Way
<!-- Old, deprecated -->
<center>
<font color="red" size="5" face="Arial">Old styling</font>
</center><!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
<!-- Centre a block with margin auto -->
<div style="width:200px; margin:0 auto; background:#cfe2ff; text-align:center; padding:10px;">
Centred box
</div><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.
