Skip to content
Tutorials Center
My learning

Topics

Lesson 111 of 122 ยท Accessibility and Best Practices

Deprecated and Obsolete Features

Recognize obsolete HTML such as font, center, big, tt, acronym, frames, marquee and presentational attributes, and learn their modern replacements.

HTML has been around for more than thirty years, and not every idea aged well. Some elements and attributes from the 1990s described appearance (big text, centered text, a red font) instead of meaning. Others, like frames, solved problems that are now handled far better in other ways. The HTML standard calls these features obsolete. You will still meet them in old sites, copy-pasted snippets and email templates, so it pays to recognize them and know what to use instead.

Deprecated, obsolete, removed

You will hear three words used loosely:

  • Deprecated was the official term in HTML 4: a feature that still worked but was expected to go away. People still use the word informally for anything old.
  • Obsolete is the term in today's HTML Living Standard. Obsolete features are non-conforming: a validator reports them as errors, and you should not use them in new pages.
  • Removed from browsers is a different matter. Because the web must not break, browsers keep rendering most obsolete elements so that old pages still work. The standard even describes how browsers should display them.

So "it still works in my browser" tells you nothing about whether you should use something. The validator in Validating Your HTML is the reliable judge.

Why the presentational elements went away

The guiding principle of modern HTML is separation of concerns: HTML describes what content is, and CSS describes how it looks. A <font color="red"> tag mixes the two. Imagine a site with 500 pages, each with dozens of font tags, and a designer who wants to change the brand color. With CSS, that is a one-line change.

Presentational markup also tells assistive technology nothing. A screen reader cannot know why some text is big or red, but it can announce a heading, emphasis or a deleted passage, because those are meanings.

Obsolete elements and their replacements

Obsolete What it did Use instead
<font> Set font face, size and color CSS font-family, font-size, color
<basefont> Default font for the page CSS on body
<center> Centered its content CSS text-align: center, or margin-inline: auto for a block, or flexbox
<big> Made text bigger CSS font-size; a heading or <strong> if it is important
<tt> Monospaced "teletype" text <code>, <kbd>, <samp> or CSS font-family: monospace
<acronym> Marked an acronym <abbr> (for all abbreviations)
<strike> Struck-through text <s> (no longer relevant) or <del> (removed edit)
<marquee> Scrolling text A CSS animation, ideally with a pause control, or no motion
<blink> Blinking text Nothing (browsers stopped blinking it long ago)
<frameset>, <frame>, <noframes> Split the window into separate documents One page with a CSS layout; <iframe> for real embedding
<applet> Embedded a Java applet Modern web technologies; plug-ins are gone
<dir> A directory list <ul>
<nobr> Prevented line wrapping CSS white-space: nowrap
<xmp>, <listing>, <plaintext> Showed raw text <pre> (with <code>), escaping < and &

The replacements for text elements are covered in Formatting Text, Quotations, Citations and Abbreviations and Code, Keyboard Input and Program Output.

Redefined, not removed. Some old presentational elements were given new, semantic meanings and are perfectly valid today: <b> (text to bring attention to, without extra importance), <i> (an alternate voice, such as a term or a ship's name), <u> (an unarticulated annotation, such as a spelling-error mark), <s> (no longer accurate), <small> (side comments and fine print) and <hr> (a thematic break). Use them for those meanings, not for their looks.

Here are the old and the modern versions side by side. Browsers still render the old elements, which is exactly why they linger in legacy code.

Obsolete vs modern markup

Notice that the modern version did not just copy the look. "Corner Bakery" became a real heading, "every day" became important text, and the order code became code. The meaning is now in the HTML, and the style lives in CSS.

Three more relics you may find in very old pages: <noembed> held fallback content for <embed> (use the fallback inside <object>, or a link, instead), <bgsound> played background music in an old Internet Explorer (use <audio> and never autoplay with sound), and <isindex> made a simple search box (use a <form> with an <input type="search">). All three are gone from browsers. The compact attribute on <ol>, <ul> and <dl> asked for a tighter list; it is obsolete too, and the CSS rules line-height, margin and padding do the job.

Frames

Before CSS layouts, many sites split the browser window into frames: a navigation file on the left, a content file on the right, each a separate document. A <frameset> took the place of <body>:

HTML
<!-- Obsolete: do not use -->
<frameset cols="200,*">
  <frame src="menu.html" name="menu">
  <frame src="welcome.html" name="content">
  <noframes>Your browser does not support frames.</noframes>
</frameset>

Frames caused real problems: the address bar always showed the same URL, so pages could not be bookmarked or shared; the back button behaved strangely; search engines indexed fragments without their navigation; and screen readers struggled to move between frames.

Today you build the same layout in one document with semantic elements and CSS Grid or Flexbox (see Page Layout). When you genuinely need to show another document inside your page, such as a map or a video player, use an iframe, which is fully valid.

Moving text: from <marquee> to CSS

<marquee> scrolled text across the screen. It still works in every major browser, and it is still a bad idea. Moving content distracts many people and can make the page unusable for people with attention or vestibular disorders. WCAG 2.2 (criterion 2.2.2, Pause, Stop, Hide) requires that motion which starts automatically, lasts more than five seconds and appears alongside other content can be paused, stopped or hidden.

If you truly need a ticker, build it with CSS, give it a pause button and respect the user's reduced motion setting:

An accessible ticker

Even better: ask whether the message needs to move at all. A clear static banner is usually more readable.

Application Cache (AppCache), removed

Before service workers, the way to make a page work offline was Application Cache. You added a manifest attribute to the <html> element, pointing at a text file:

HTML
<!doctype html>
<html lang="en" manifest="site.appcache">
TEXT
CACHE MANIFEST
# v12
CACHE:
/index.html
/app.css
/app.js

NETWORK:
*

FALLBACK:
/ /offline.html

The browser downloaded everything under CACHE: and served it without the network. It looked simple, but it had traps:

  • The page that referenced the manifest was always cached, so you could not fix a broken page without changing the manifest file.
  • The manifest was only re-checked when its bytes changed, which is why people edited a # v12 comment on every release.
  • There was no way to say "network first" or to handle one failing request in code. Everything was declarative and all-or-nothing.

AppCache was deprecated and then removed from browsers (Chrome dropped it in version 70 for secure contexts and Firefox in version 84). The manifest attribute on <html> is now obsolete and does nothing. Do not confuse it with the web app manifest (<link rel="manifest">), which is alive and describes an installable app.

The replacement is a service worker, a script that sits between your page and the network and decides, in code, what to serve from a cache. You get the same offline pages plus real control over strategies and updates. Learn it in Progressive Web Apps. If you inherit a site that still has manifest="..." on <html>, delete the attribute and the manifest file.

Obsolete presentational attributes

Many attributes that controlled appearance are obsolete too. They are often found in old tables and email templates.

Obsolete attribute Found on Use instead (CSS)
align p, div, img, table, td, headings text-align, margin-inline: auto, flexbox or grid
valign td, th, tr vertical-align
bgcolor body, table, tr, td background-color
background body, table, td background-image
border table, img border
cellpadding, cellspacing table padding on cells, border-spacing or border-collapse
width, height table, td, th, hr width, height
hspace, vspace img margin
text, link, vlink, alink body color and a:link, a:visited, a:active
nowrap td, th white-space: nowrap
clear br clear on the following element
frameborder, scrolling iframe border, overflow
name a an id on the target element
language script omit it

Not everything old is obsolete. width and height on <img>, <video>, <canvas> and <iframe> are valid and recommended: they let the browser reserve space before the content loads (see Fast-Loading HTML). The type attribute on <ol> is also valid, because the numbering style can be part of the meaning.

You will also see type="text/javascript" on scripts and type="text/css" on style elements. They are not harmful, but they are unnecessary, because JavaScript and CSS are the defaults. Validators suggest removing them.

Cleaning up an old page

When you inherit legacy markup, work through it in this order:

  1. Add <!doctype html> so the page renders in standards mode (see HTML vs XHTML).
  2. Run the validator to get a full list of obsolete features.
  3. Replace structure first: frames and layout tables become semantic elements plus CSS.
  4. Replace presentational elements and attributes with classes and a stylesheet. Ask what each piece means; a red, big <font> is often really a heading or a warning.
  5. Check accessibility: remove or tame motion, and make sure the new semantics read well.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does "obsolete" mean in the current HTML standard?

    Browsers keep rendering many obsolete features for compatibility, but validators report them as errors and new pages should not use them.
  2. 2. Which is the modern replacement for <acronym>?

    <abbr> covers all abbreviations, including acronyms. <tt> is itself obsolete.
  3. 3. Which of these is still valid in modern HTML?

    Image width and height are valid and help prevent layout shift. The others are presentational and belong in CSS.
  4. 4. Why is <marquee> problematic beyond being obsolete?

    Moving content that starts automatically and lasts more than five seconds must be pausable under WCAG 2.2.2.

Summary

  • Obsolete features are non-conforming; browsers may still render them, but new pages should not use them.
  • Presentational elements (<font>, <center>, <big>, <tt>, <strike>) and attributes (align, bgcolor, cellpaddingโ€ฆ) are replaced by CSS.
  • <acronym> became <abbr>; <b>, <i>, <u>, <s> and <small> were redefined with semantic meanings.
  • Frames are replaced by CSS layouts in one document, with <iframe> for real embedding.
  • The manifest attribute and the AppCache (CACHE MANIFEST) system are gone; use a service worker for offline pages.
  • Replace <marquee> with no motion, or a CSS animation that can be paused and respects reduced-motion settings.
  • width and height on images and media are not obsolete; keep using them.

Next up: Fast-Loading HTML.