HTML Deprecated Attributes

Deprecated attributes are attributes that are no longer supported by HTML. For this reason, you should not use these and use alternatives instead.

HTML Reference

Browser Support

Browsers support deprecated attributes for a while, but at some point they will be phased out.

With HTML5 the number of attributes has been reduced in favor of CSS.

Deprecated attributes are often easily handled with CSS, for example, HTML bgcolor versus CSS background-color.

List of Deprecated Attributes

This table lists the deprecated HTML attributes. It has the attribute, the HTML elements affected, a description, and the alternatives you can use.

Attribute Elements Description Alternative
abbr td Contains abbreviated description of a cell's content. abbr tag
accept form List of file extensions that are accepted in file picker. accept attribute
on <input type="file">
align caption, iframe, img, input, object, legend, table, hr, div, h1, h2, h3, h4, h5, h6, p, col, colgroup, tbody, td, tfoot, th, thead and tr. Aligns the content in an element. CSS text-align
alink body Specifies color of active links in a page. CSS color
archive object List of URLs for resource archives for the object. n/a
axis td, th List of header ids that cell applies to or vice versa. headers attribute for td, scope attribute for th
autocapitalize any tag Autocapitalizes text entered by the user. n/a
background body Specifies URL of background image for a page. CSS background-image
bgcolor table, tr, td, th and body. Defines background color for element. CSS background-color
border table and object Defines the border thickness around the element. CSS border
bottommargin body Specifies the margin to the bottom of the page CSS margin
cellpadding table Defines space between cells and their borders CSS border-collapse on table, with CSS padding on td cells.
cellspacing table Defines the size of the space between table cells. CSS border-spacing on table
char col, colgroup, tbody, td, tfoot, th, thead and tr. Aligns content to a character, for example "," or ".". CSS text-align
charset script, link, and a Sets character encoding of linked URL. Content-Type HTTP header
charoff col, colgroup, tbody, td, tfoot, th, thead and tr. Shifts column data to the right relative char attribute. CSS text-align
classid object The URL of the object's implementation. n/a
clear br Specifies where to start the next line after the break. n/a
codebase object Base path for URLs specified by classid, data, or archive. codebase tag
codetype object Defines content type of the data specified by classid. n/a
cols pre Sets the preferred character count for a line. CSS width
compact dl, menu, ol and ul. Renders the list in a compact style CSS line-height
coords a A comma-separated list of coordinates area tag
declare object Makes this element a declaration only. Still needs instantiation. n/a
frame table Defines on which side a border should be displayed. CSS border
frameborder iframe Draws a border around the frame CSS border
height td Sets the height of an element CSS height
hspace img and object. Horizonal spacing in pixels, left and right of element. CSS margin
language script Defines the language of the script type attribute
leftmargin body Specifies the margin to the left of the page CSS margin
link body Specifies color of unvisited links on page CSS color
longdesc img and iframe. URL of a detailed description of the elements content n/a
manifest html Sets a URL with resources that should be cached locally. n/a
marginheight iframe Space between iframe content and top and bottom borders. CSS padding
marginwidth iframe Space between iframe content and left and right borders. CSS padding
name a, img, area, form Defines a name for the element. id attribute
nohref area Indicates no hyperlink exists for the associated area. Not providing href is sufficient
noshade hr Sets the rule to have no shading CSS box-shadow
nowrap td, th, dd Specifies that the content should not wrap CSS white-space: nowrap
profile head URLs of space separated metadata profiles. n/a
rev link, a Specifies a reverse link. The opposite of rel. n/a
rightmargin body Specifies the margin to the right of the page CSS margin
rules table Defines which table lines should be drawn CSS border on thead, tfoot, tbody, col, colgroup.
scheme meta Defines format or URL for interpreting the content attribute n/a
scope th Defines the data cells the header is related to. headers on td
scrolling iframe Specifies when scrollbar should appear on iframe. CSS overflow
shape a The shape of a link's region in an image map <area> element
size hr Sets the height of the rule CSS height
sorted the Specifies the sort direction of the column n/a
standby object A message while object and data are loading. n/a
summary table Defines alternative text that summarize table caption tag
tabindex object, area The position of the element in the tabbing sequence. n/a
target link Defines a frame or window that has additional info on the link n/a
text body Specifies text color of the page. CSS color
topmargin body Specifies the margin to the top of the page CSS margin
type li, ol, ul, param, area The type of list or item with bullets. CSS list-style-type
valign col, colgroup, tbody, td, tfoot, th, thead, tr Sets the vertical alignment of content in the element CSS vertical-align
valuetype param Specifies the type of the value: data, ref, or object n/a
version html Specifies the DTD (data type definition) version of the HTML. Redundant in HTML5. n/a
vlink body Specifies color of visited links on the page CSS color
vspace img, object Vertical spacing in pixels, top and bottom of element. CSS margin
width hr, table, td, th, col, colgroup, pre Sets the width of the element CSS width
wrap pre Suggests how text overflow should be handled CSS overflow

You may also like