Unsupported Tags In HTML5
April 20th, 2010
I’ve been planning on writing some posts on HTML5 for awhile now. To kick it off, I thought I would post a simple list of tags that are no longer supported in HTML5. Included in the list are a number of fairly common tags like <font> and <center>. However, if you’ve been keeping your CSS up to date, you should have stopped using these tags already. To help ease the pain, I’ll try and recommend an alternative solution for all the discontinued tags.
<acronym>
Used for defining an acronym. For example, NHL. There’s not really a clear cut alternative but you could consider using the <section> or <mark> tags.
<applet>
Used for defining an embedded applet. An alternative you could consider using is the new <embed> tag.
<basefont>
Used for defining a base font color, size, or font family for an entire document. You should already be doing this using CSS on the body selector. Below is some sample code:
body {
font-family: helvetica, sans-serif;
font-size: 12pt;
color: #000;
}
<big>
Used for making text bigger. An easy alternative to this would be to use some CSS to create a class called .big. Then wrap any text you want to be big in a <span> tag with the .big class. So something like this:
.big {
font-size: 3em;
}
<span class="big">big text here</span>
<center>
Used to center text or elements. This is an easy fix using some CSS, see the example below:
.element {
text-align: center;
}
<dir>
Used to define a directory list. The best alternative is to use the <ul> tag.
<font>
Used to set font color, size, or weight. Once again this is an easy fix with CSS. Take a look at the above example for <basefont> to see some example code.
<frame>
Used to define a frame. Side Note: YES! NO MORE FRAMES! Alternative? Study layout design and hierarchy.
<frameset>
Used to define a frame set. See above for an alternative :)
<noframes>
Used to display text for browsers that didn’t support frames. I don’t think an alternative is required.
<s> and <strike>
Used to put a strikethrough text. As an alternative, you can use the <del> tag.
<tt>
Used to define teletype text. As an alternative, use CSS to style the particular text with a class.
<u>
Used to add an underline to text. As an alternative, use the CSS text-decoration property. Here’s an example:
.underline-text {
text-decoration: underline;
}
<xmp>
Used to define pre-formatted text. Instead, you should use the <pre> tag.
Print This Post
6 Comments on “Unsupported Tags In HTML5”
hehe no mention of the blink tag here:
April 21, 2010 » 1:49 pm
We should not use or to replace <acronym>. The correct tag is <abbr> I believe.
April 30, 2010 » 1:01 am
Good call, I missed that one. Yep <abbr> is the way to go when replacing the acronym tag for html5
April 30, 2010 » 2:25 pm
Oops, lots of typos, glad this is moderated! Let me try again:
A very common use of the <center> tag has been to center tables. However, replacing <center> with <div style=text-align: center> not only doesn’t work but leads to centering the text in the cells of the tables. Using <table style=text-align: center> is no better.
Fortunately, a not so widely advertised feature of table margins is that they, of all things, may be used to center tables, as in:
<table style=”margin: auto auto”>
I wonder how many people would have guessed from the advice “use CSS instead.”
September 11, 2010 » 7:57 am
Hey Jim,
I’d stay away from the inline styles. I’d recommend breaking that out into a class. Thanks for your comment
September 11, 2010 » 4:54 pm
Wooooooooho!! blink tag is still in :) !!
April 21, 2010 » 1:07 pm