Avoid deprecated features of W3C technologies.
Avoid deprecated features of W3C technologies.
If you’re coding with a strict doctype, you definitely don’t want to use any deprecated attributes or elements. So, what are those deprecated elements and attributes that you shouldn’t use? See below:
Deprecated Elements
| Name | Description | Alternative |
|---|---|---|
| applet | Java applet | |
| basefont | base font size | font-size: 100%; |
| center | shorthand for DIV align=center | text-align: center; |
| dir | directory list | |
| font | local change to font | font-family: arial; font-size: 0.8em; |
| isindex | single line prompt | |
| menu | menu list | |
| s | strike-through text style | text-decoration: line-through; |
| strike | strike-through text | text-decoration: line-through; |
| u | underlined text style | text-decoration: underline; |
| marquee | moving text | |
| blink | blinking text | |
| embed | videos, flash or audio insert | object |
| b | bold text | strong |
| i | italic text | em |
Deprecated Attributes
| Attribute | Deprecated in these elements | CSS (or HTML) Alternative |
|---|---|---|
| align | caption, img, input, object, legend, table, hr, div, h1, h2, h3, h4, h5, h6, p | CSS attribute: text-align |
| alink, link, vlink | body | CSS selectors: a, a:link, a:visited, a:hover, a:active,
a:visited:hover CSS attribute: color: |
| background | body | CSS attribute: background-image: |
| bgcolor | table, tr, td, th, body | CSS attribute: background-color: or background: |
| border | img, object | CSS attribute: border: |
| clear | br | CSS attribute: clear: left | right | both | none |
| compact | dl, ol, ul | CSS attribute: line-height, min-height or height: with overflow: set. |
| height | td, th | CSS attribute: line-height for cell content; don’t use tables for layout |
| hspace | img, object | CSS attribute: padding |
| language | script | HTML attribute: type HTML attribute value: MIME type, ex. type="text/javascript" |
| name | img, a, applet, form, frame, iframe, map | HTML attribute: id |
| noshade | hr | |
| nowrap | td, th | CSS attribute: white-space: |
| size | hr | CSS attribute: width: or margin: |
| start | ol | |
| target | a | |
| text | body | CSS attribute: color |
| type | li, ol, ul | CSS attribute: list-style-type |
| value | li | |
| version | html | HTML Markup: use a DTD |
| vspace | img, object | CSS attribute: padding: or margin: |
| width | hr, td, th, pre | CSS attribute: width: |
