← Back to HTML Course | Chapter 9: Reference & Advanced | Lesson 9 of 9

HTML Deprecated Tags

HTML has been evolving since the early 1990s, and along the way a batch of early tags -- mostly ones that mixed visual styling directly into markup -- were officially deprecated once CSS became the standard way to handle presentation. Browsers still render most of these old tags for backward compatibility, but they are not part of the HTML5 specification, so new projects should never use them.

Why These Tags Were Deprecated

Early HTML mixed content structure and visual presentation together in the same tags, meaning a page's styling was baked directly into its markup. As CSS matured into a complete, dedicated styling language, HTML deprecated most presentational tags in favor of keeping structure (HTML) and style (CSS) cleanly separated -- a principle that makes sites easier to maintain and restyle.

Note: If you inherit an old codebase full of deprecated tags, treat it as a strong signal to gradually migrate that styling into CSS rather than extending it further.

Warning: A tag still rendering in your browser today does not mean it is safe to use going forward -- browsers keep old tags working purely for backward compatibility with decades-old websites.

Example: Why These Tags Were Deprecated

markup
<!-- Old: presentation mixed into markup -->
<font color="red">Warning text</font>
<!-- Modern: structure and style separated -->
<p style="color: red;">Warning text</p>

Text Styling Tags to Replace

<font>, <basefont>, <big>, <tt>, and <strike> all controlled font family, size, color, or basic text effects directly in markup. Each has a direct CSS replacement: font-family/color/font-size for <font> and <basefont>, font-size for <big>, font-family: monospace for <tt>, and text-decoration: line-through (or the semantic <s> element) for <strike>.

Note: When migrating old markup, replace <font color="..." size="...">text</font> with a styled <span> or a CSS class -- never leave the old tag in place.

Warning: <strike> is easy to confuse with the still-valid <s> element -- <strike> is deprecated, while <s> (a different, still-supported tag) is the modern equivalent.

Example: Text Styling Tags to Replace

markup
<!-- Deprecated -->
<font size="5" color="blue">Big blue text</font>
<strike>Old price</strike>
<!-- Replacement -->
<span style="font-size: 20px; color: blue;">Big blue text</span>
<s>Old price</s>

Layout Tags to Replace

<center> and <marquee>-era layout tags forced specific visual positioning directly into markup. <center> is replaced by text-align: center (for text) or margin: 0 auto (for centering a block element), while table-based layouts using deprecated attributes are replaced entirely by CSS Flexbox or Grid.

Note: Replace any <center> tag with text-align: center in CSS, or margin: auto plus a defined width if you are centering a block-level container.

Warning: Old table-based page layouts (using tables purely for visual positioning rather than tabular data) are considered an outdated practice, even though the <table> tag itself remains fully valid for actual data.

Example: Layout Tags to Replace

markup
<!-- Deprecated -->
<center>Centered text</center>
<!-- Replacement -->
<p style="text-align: center;">Centered text</p>

Frame and Embed Tags to Replace

<frame>, <frameset>, and <noframes> split a browser window into multiple independently-scrolling documents, a technique now replaced by <iframe> (for embedding one external document) or CSS Grid/Flexbox layouts (for splitting a single page into visual regions). <applet> (Java applets) is replaced by <embed> or <object> for any remaining plugin content, though modern web apps avoid browser plugins entirely.

Note: If you see a <frameset>-based layout, it needs a full redesign using <iframe> or a CSS-based multi-panel layout -- there is no simple drop-in replacement.

Warning: <applet> relied on the Java plugin, which no modern browser supports at all anymore, making any surviving applet-based content completely non-functional today.

Example: Frame and Embed Tags to Replace

markup
<!-- Deprecated -->
<frameset>
  <frame src="page1.html">
</frameset>
<!-- Replacement -->
<iframe src="page1.html"></iframe>

Quick Reference: Deprecated Tag to Modern Replacement

As a fast lookup: <acronym> to <abbr>, <applet> to <embed>/<object>, <basefont>/<font> to CSS font properties, <big>/<small> visual sizing to CSS font-size, <center> to CSS text-align/margin, <dir> to <ul>, <frame>/<frameset>/<noframes> to <iframe> or CSS layout, <strike> to <s> or <del>, and <tt> to <code> or CSS font-family: monospace.

Note: Keep this mapping handy when auditing an old codebase -- most deprecated-tag migrations are a direct one-to-one swap to a CSS property or a still-valid semantic tag.

Warning: A handful of these deprecated tags (like frameset) require a structural redesign rather than a simple one-to-one swap, since their entire layout model has been replaced.

Example: Quick Reference: Deprecated Tag to Modern Replacement

markup
<!-- <acronym> -> <abbr> -->
<abbr title="HyperText Markup Language">HTML</abbr>
<!-- <tt> -> <code> -->
<code>console.log()</code>
Common Mistakes
  1. Copy-pasting old code containing <center>, <font>, or <marquee>-style tags into a new project without realizing they were deprecated years ago.
  2. Assuming a deprecated tag "still works fine" is the same as it being valid -- most still render in browsers today purely for backward compatibility with old websites, not because they are recommended.
  3. Not knowing the CSS replacement for a deprecated tag, and reaching for inline styles as a workaround instead of the clean, intended CSS property.
Chapter Summary
  • Deprecated tags mixed visual styling into HTML markup; CSS now handles all of that styling instead.
  • Browsers still render most deprecated tags for backward compatibility, but they are excluded from the HTML5 specification and should not be used in new code.
  • Every deprecated presentational tag has a direct CSS equivalent that offers more control and keeps styling separated from structure.
Browser Support

All tags on this page still render in current browsers for backward-compatibility reasons, but none are part of the HTML5 specification and none should be used in new projects.

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.