What are Deprecated HTML Attributes?
Deprecated or obsolete HTML attributes are those that are no longer recommended for use, often because they have been replaced by modern HTML5 attributes. These changes improve functionality, accessibility, and compliance with current web standards. Here are the key points to understand:
- HTML elements are the foundation of every web page, and attributes add extra functionality or control to these elements.
- Since the early days of HTML, attributes have been created alongside tags to deliver specific outcomes.
- Over time, some attributes failed to meet modern development needs, much likedeprecated HTML elements.
- With each major update, certain attributes are marked as deprecated and discouraged for new projects.
- Deprecated attributes remain usable for a while but lose official support over time.
- Eventually, they are removed entirely, becoming obsolete in later versions of the HTML language.
HTML Deprecated Attributes Alphabetical Reference
The following table lists all 87 HTML attributes that are deprecated or obsolete, organized in alphabetical order for easy reference.
ATTRIBUTE | TAG NAME | ALTERNATIVE | DESCRIPTION |
---|---|---|---|
abbr | <td>, <th> | <abbr> | This HTML attribute specifies the abbreviation and accepts a text value. |
accept | <form> | <input> | This HTML attribute restricts the user to select a specific type of file (only for type=”file”). |
align | <applet>, <caption>, <col>, <colgroup>, <iframe>, <img>, <input>, <legend>, <hr>, <div>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <object>, <table>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr> | CSS text-align Property | The align HTML attribute was utilized to align the content according to surrounding elements. |
alink | <body> | CSS :active Pseudo Class | This HTML attribute defines the color of the link when a user selects it. |
allowtransparency | <iframe> | CSS Styles | The allowtransparentcy HTML attribute defines the transparency of an iframe element. |
alt | <applet> | n/a | This HTML attribute defines an alternative text for the applet element. |
archive | <applet>, <object> | n/a | The archive HTML attribute specifies a list of URIs separated by spaces. |
axis | <td>, <th> | headers Attribute | This HTML attribute creates a list of related headers separated by commas. |
background | <body>, <table>, <tbody>, <tfoot>, <td>, <thead>, <th>, <tr> | CSS background-image Property | The background HTML attribute sets the background image by taking the image URL. |
bgcolor | <body>, <col>, <colgroup>, <marquee>, <table>, <tr>, <td>, <th>, <body>, <tfoot> | CSS background-color Property | This HTML attribute sets the background color of an element. |
border | <img>, <input>, <object>, <table> | CSS border Property | The border HTML attribute defines the width of the border for an element. |
bordercolor | <table> | CSS border-color Property | This HTML attribute defines the color of the border for an element. |
bottommargin | <body> | CSS margin-bottom Property | The bottommargin HTML attribute sets the margin at the bottom of the page. |
cellpadding | <table> | CSS padding Property | This HTML attribute sets the spacing within the cells. |
cellspacing | <table> | CSS border-collapse Property | The cellspacing HTML attribute sets the space between the cells. |
char | <col>, <colgroup>, <tbody>, <td> <tfoot>, <th>, <thead>, <tr> | n/a | This HTML attribute declares an alignment char, e.g. char=’:’. |
charoff | <col>, <colgroup>, <tbody>, <td> <tfoot>, <th>, <thead>, <tr> | n/a | The charoff HTML attribute sets the offset for the alignment char. |
charset | <a>, <link>, <meta>, <script> | HTTP 'Content-Type' Header | This HTML attribute specifies the character encoding for the current document or external script file. |
classid | <object> | n/a | The classid HTML attribute identifies the implementation of the URI. |
clear | <br> | CSS clear Property | This HTML attribute controls the flow of text. |
code | <applet>, <object> | n/a | The code HTML attribute sets the URL of the applet’s class file for loading. |
codebase | <applet>, <object> | <base> | This HTML attribute provides the absolute or relative URL of the directory that stores the class files of the applet element. |
codetype | <object> | n/a | The codetype HTML attribute tells about the content type of the code attribute. |
color | <basefont>, <font>, <hr> | CSS color Property | This HTML element specifies the color of the text of an element. |
compact | <dir>, <dl>, <menu>, <ol>, <ul> | CSS line-height Property | The compact HTML attribute declares the spacing between the items. |
contextmenu | Global Attribute | JavaScript | This HTML attribute defines the ID of a menu element which will serve as the element’s context menu. |
coords | <a> | <area> | The coords HTML attribute set the coordinates of an area. |
datapagesize | <table> | n/a | This HTML attribute is unnecessary for the table element. |
datasrc | <a>, <button>, <div>, <frame>, <iframe>, <img>, <input>, <label>, <legend>, <marquee>, <object>, <option>, <select>, <span>, <table>, <textarea> | XMLHttpRequest | The datasrc HTML attribute declares the identifier of the data source that is linked to the element. |
datafld | <a>, <button>, <div>, <fieldset>, <frame>, <iframe>, <img>, <input>, <label>, <legend>, <marquee>, <object>, <select>, <span>, <textarea> | XMLHttpRequest | The datafld HTML attribute defines the XML note that will be placed inside the HTML element. |
dataformatas | <button>, <div>, <input>, <label>, <legend>, <marquee>, <object>, <select>, <span>, <table> | XMLHttpRequest | This HTML attribute declares the rules of how data will be rendered. |
declare | <object> | Repeat the <object> | The declare HTML attribute declares the object but does not instantiate it. |
dropzone | All Elements | JavaScript | This HTML attribute specifies instructions for the dragged data to copy, move, or link upon dropping. |
event | <script> | DOM Events | The event HTML attribute sets or retrieves the event for which the script is written. |
face | <basefont>, <font> | CSS font-family Property | This HTML attribute defines a list of font names separated by commas. |
for | <script> | DOM Events | The for HTML attribute sets or retrieves the object that is bound to the event script. |
frame | <table> | CSS Styles | This HTML attribute indicates the browser to display which part of the table. |
frameborder | <frame>, <iframe> | CSS border Property | The framborder HTML attribute tells the browser whether to display the border of a frame or not. |
framespacing | <frame>, <iframe> | CSS margin Property | This HTML attribute sets the spacing between the frames in a frameset. |
height | <table>, <tbody>, <td>, <tfoot>, <th>, <thead>, <th>, <applet> | CSS height Property | The height HTML attribute sets the height of an element. |
hreflang | <area> | n/a | This HTML attribute tells the language of the linked document or resource. |
hspace | <embed>, <iframe>, <img>, <input>, <object> | CSS height Property | The hspace HTML attribute defines white space or padding on the left or right side of an element. |
intrinsicsize | <img> | CSS Styles | This HTML attribute ignores the original image size and provides its own defined size for the image. |
language | <input>, <menu> | type Attribute | The language HTML attribute declares the title of the text/subtitle track in a video. |
language | <script> | n/a for JavaScript | This HTML attribute defines the script language. |
leftmargin | <body> | CSS margin-left Property | The leftmargin HTML attribute sets the margin on the left side of the web page. |
link | <body> | CSS :link Pseudo Class | This HTML attribute sets the color of the links. |
longdesc | <img>, <frame>, <iframe> | <a> | The longdesc HTML attribute adds the long description file as a link. |
lowsrc | <img> | n/a | This HTML attribute adds a low-resolution image or an alternative resource image. |
manifest | <body> | Service Workers | The manifest HTML attribute defines the URL of the document’s cache manifest. |
marginheight | <frame>, <iframe> | CSS Padding Property | This HTML attribute sets the margin height of a frame in pixels. |
marginwidth | <frame>, <iframe> | CSS padding Property | The marginwidth HTML attribute sets the margin width of a frame in pixels. |
name | <applet>, <a>, <embed>, <img>, <option> | id Attribute | This HTML attribute sets the name of an applet element but now it is deprecated. |
nohref | <area> | n/a | The nohref HTML attribute tells the browser that there is no action or link. |
noshade | <hr> | CSS box-shadow Property | This HTML attribute defines a horizontal rule in a solid color without any shade. |
nowrap | <td>, <th> | CSS white-space Property | The nowrap HTML attribute disables the word wrap ability. |
object | <applet> | n/a | This HTML attribute specifies a serialized object file for an applet element. |
onshow | All visible elements. | JavaScript | The onshow attribute triggers some scripts when contextmenu is opened. |
profile | <head> | n/a | This HTML attribute specifies the URI or a file or files separated by space while adding metadata. |
prompt | <isindex> | n/a | The prompt HTML attribute sets a prompt message. |
rev | <a>, <link> | rel Attribute | This HTML attribute tells the relation between the current document and the liked document. |
rightmargin | <body> | CSS margin-right Property | The rightmargin HTML attribute sets the margin of the right side of the web page. |
rules | <table> | CSS border Property | This HTML attribute defines which parts of the inside borders are visible. |
scheme | <meta> | Use one scheme per field | The scheme HTML attribute defines a scheme to employ for the content attribute in the meta element. |
scope | <td>, <th> | headers Attribute | This HTML attribute specifies the scope of the header cell. |
scoped | <style> | n/a | The scoped HTML attribute declares the styles for the parent or children of the current element and not for the entire document. |
scrolling | <frame>, <iframe> | CSS overflow Property | This HTML attribute allows us to display the scrollbar or not. |
shape | <a> | <area> | The shape HTML attribute defines the shape of an element. |
size | <hr>, <font>, <basefont> | CSS height Property | This HTML attribute limits characters or the number of visible options. |
standby | <object> | Optimize Resource | The standby HTML attribute flaunts a message while the object element loads. |
start | <ol> | CSS counter-reset Property | This HTML attribute sets the starting value of an ordered list. |
summary | <table> | <caption> | The summary HTML attribute adds the purpose or structure of the data. |
target | <link> | n/a | This HTML attribute sets the target location of the link to where it opens or the form submits. |
text | <body> | CSS color Property | The text HTML attribute defines the color of the text of a document. |
topmargin | <body> | CSS margin-top Property | This HTML attribute defines the margin on the top of the page. |
type | <li>, <area>, <menu>, <ol>, <ul>, <style> | CSS list-style-type Property,
n/a for <style> |
The type HTML attribute defines the type of the element. |
typemustmatch | <object> | n/a | This HTML attribute defines the type attribute and the resource item type must match. |
urn | <a>, <link> | href Attribute | The urn HTML attribute acts as an identity of an external document. |
usemap | <img>, <input>, <object> | <img> | This HTML attribute declares an image to be used as a map. |
valign | <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr> | CSS vertical-align Property | The valign HTML attribute sets the verticle alignment in the cells. |
value | <li> | n/a | This HTML attribute defines the value of an element. |
valuetype | <param> | n/a | The valutype HTML attribute tells how to interpret the value of the param element. |
version | <html> | n/a | This HTML attribute tells the browser which HTML DTD version regulates the current document. |
vlink | <body> | CSS :visited Pseudo Class | The vlink HTML attribute sets the color of the visited links. |
vspace | <applet>, <embed>, <iframe>, <img>, <input>, <object> | CSS margin Property | This HTML attribute sets the verticle gutter for an element. |
width | <applet>, <canvas>,<col>, <colgroup>, <embed>, <hr>, <iframe>, <img>, <input>, <object>, <pre>, <table>, <td>, <th>, <video> | CSS width Property | The width HTML attribute defines the width of an element. |
wrap | <pre>, <textarea> | CSS overflow Property | This HTML attribute controls the overflow of the text from the element. |
HTML Attributes Reference
For a complete overview of all 270+ HTML attributes, visit the HTML5 attribute reference.