Things to to be avoided in HTML 5

HTML tags to be avoided

There are a number of tags and attributes which have been deprecated in HTML 5 or earlier versions which may still work in some browsers. For backward compatibility with existing documents, the HTML specifications may even require these deprecated elements and attributes to continue to be supported by HTML 5 compliant browsers and document processors. However, when creating web documents conforming to the HTML 5 specifications, authors should avoid these deprecated HTML tags.

Here is a list of HTML tags that should be avoided:

Deprecated attributes in HTML 5

In addition, the following deprecated attributes are no longer included in the HTML 5 specification. Therefore, the following list of attributes should be avoided:

Other things to avoid in HTML 5

Here are some other things that should be avoided in HTML documents:

The <acronym> Tag in HTML 5

The <acronym> tag in HTML 5

The <acronym> tag should not be used in HTML 5 because it is not a valid HTML element in the HTML 5 specification (see "<acronym> is not supported in HTML 5. Use <abbr> instead." or "Authors are to use <abbr> for abbreviations." in HTML 5 differences from HTML 4).

Acronyms should be enclosed by the HTML <abbr> tag. Since some browsers, most notably IE, do not activate the tool tip to assist the user when the title attribute appears on the abbr tag, the abbr tag should be placed inside an <a> tag with the title. The href attribute on the a tag also allows acronyms to be disambiguated. The easiest way to do this is simply look up the HTML code for any acronyms that you want to use in the acronym directory, at Acronyms .net.

Examples

<a href="http://www.Acronyms.net/terms/t/Three-Letter-Acronym/" title="Three Letter Acronym">
<abbr>TLA</abbr>
</a>

If you are not sure of the proper spelling of an acronym, you can search for acronyms based on the meaning of the acronym in the Acronym Finder. then click on the "usage" link for that term and copy-and-paste the code provided.

The <applet> Tag in HTML 5

The <applet> tag in HTML 5

The <applet> tag should be avoided because it has been deprecated since HTML version 4. The <object> tag should be used instead.

The <bgsound> Tag in HTML 5

The <bgsound> tag in HTML 5

The <bgsound> tag should be avoided because it has been deprecated. The <audio> tag should be used instead.

The <center> Tag in HTML 5

The <center> tag in HTML 5

The <center> tag should be avoided because it has been deprecated since HTML version 4.

The <dir> Tag in HTML 5

The <dir> tag in HTML 5

The <dir> tag should be avoided because it has been deprecated since HTML version 4.

The <fn> Footnote Tag in HTML 5

The <fn> tag in HTML 5

The <fn> tag should be avoided because it has been deprecated. An <a href="#..."> tag with a hash (fragment) destination should be used instead.

Font Tags in HTML 5

The <font> and <basefont> tags in HTML 5

The <font> and <basefont> tags should be avoided because it has been deprecated since HTML version 4. Fonts should be provided using CSS rather than the <font> tag.

Frame Tags in HTML 5

The <frameset>, <frame> and <noframes> tags in HTML 5

Frames should be avoided because they are no longer valid in the HTML 5 specification.

Inline Style Tags in HTML 5

Styles in HTML 5

The following inline style tags should be avoided because they are not valid in HTML 5:

Styles of elements in HTML documents should be provided using CSS rather than inline style tags.

The <isindex> Tag in HTML 5

The <isindex> tag in HTML 5

The <isindex> tag should be avoided because it has been deprecated since HTML version 4.

The <layer> Tags in HTML 5

The <layer> tags in HTML 5

The <layer> <ilayer> and <nolayer> tags should be avoided because they have been deprecated. The <iframe> tag should be used instead.

The <listing> Tag in HTML 5

The <listing> tag in HTML 5

The <listing> tag should be avoided in any HTML because it has been deprecated since HTML version 3.2. The HTML <pre> tag should be used instead.

The <marquee> Tag in HTML 5

The <marquee> tag in HTML 5

The <marquee> tag should be avoided because it has been deprecated.

The <nobr> Tag in HTML 5

The <nobr> tag in HTML 5

The <nobr> tag should be avoided because it is not included in the HTML specifications. White space wrapping should be controlled using the CSS white-space property and line breaks should be created using the HTML break tag "<br/>".

The <embed> Tag in HTML 5

The <embed> tag in HTML 5

The <noembed> tag should be avoided because it has been deprecated.

The <noscript> Tag in HTML 5

The <noscript> tag in HTML 5

The <noscript> tag should be avoided because it is handled differently by different browsers.

The <plaintext> Tag in HTML 5

The <plaintext> tag in HTML 5

The <plaintext> tag should be avoided in any HTML because it has been deprecated since HTML version 3.2. Instead, change all "<" and ">" characters to "&lt;" and "&>" respectively.

The <spacer> Tag in HTML 5

The <spacer> tag in HTML 5

The <spacer> tag should be avoided in any HTML because it was never supported by some browsers (notably Internet Explorer) and has been deprecated.

The <xml> Tag in HTML 5

The <xml> tag in HTML 5

The <xml> tag should be avoided because it has been deprecated. The <audio> tag should be used instead.

Note that this <xml> tag, which should not be used, is not the same thing as the <xml> declaration which appears at the very beginning of HTML documents.

The <xmp> Tag in HTML 5

The <xmp> tag in HTML 5

The <xmp> tag should be avoided in any HTML because it has been deprecated since HTML version 3.2. The HTML <pre> tag should be used instead.

The accesskey Common Attribute in HTML 5

The accesskey common attribute in HTML 5

The accesskey attribute should not be coded on any HTML tags because it has been deprecated.

The onreset Event Attribute in HTML 5

The onreset event attribute in HTML 5

The onreset attribute should not be coded on any HTML tags because it has been deprecated.

Last updated Sunday August 9, 2009


Printer-friendly PDF* format:

Things to Avoid in HTML 5

You are currently viewing this page in XHTML 1 Style Sheet* format (* see Clicklets for more infomation). This document is also available in XHTML 1*XML*HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.