12 Obsolete features
12.1 Obsolete but conforming features
Features listed in this section will trigger warnings in conformance checkers.
Authors should not specify a border attribute on an
img element. If the attribute is present, its value
must be the string "0". CSS should be used
instead.
Authors should not specify a language attribute on a
script element. If the attribute is present, its value
must be an ASCII case-insensitive match for the string
"JavaScript" and either the type attribute must be omitted or
its value must be an ASCII case-insensitive match for
the string "text/javascript". The attribute
should be entirely omitted instead (with the value "JavaScript", it has no effect), or replaced with use
of the type attribute.
Authors should not specify the name attribute on a
elements. If the attribute is present, its value must not be the
empty string and must neither be equal to the value of any of the
IDs in the element's home
subtree other than the element's own ID, if any, nor be equal to the value of
any of the other name attributes on
a elements in the element's home
subtree. If this attribute is present and the element has an
ID, then the attribute's value must
be equal to the element's ID. In
earlier versions of the language, this attribute was intended as a
way to specify possible targets for fragment identifiers in URLs. The id
attribute should be used instead.
Authors should not, but may despite requirements to the contrary
elsewhere in this specification, specify the maxlength and size attributes on input
elements whose type attributes
are in the Number state.
One valid reason for using these attributes regardless is to help
legacy user agents that do not support input elements
with type="number" to still render the text
field with a useful width.
In the HTML syntax, specifying a DOCTYPE that is an obsolete permitted DOCTYPE will also trigger a warning.
12.2 Non-conforming features
Elements in the following list are entirely obsolete, and must not be used by authors:
appletacronymUse
abbrinstead.bgsoundUse
audioinstead.dirUse
ulinstead.frameframesetnoframesEither use
iframeand CSS instead, or use server-side includes to generate complete pages with the various invariant parts merged in.isindexUse an explicit
formand text field combination instead.listingnextidUse GUIDs instead.
noembedplaintextUse the "
text/plain" MIME type instead.rbProviding the ruby base directly inside the
rubyelement is sufficient; therbelement is unnecessary. Omit it altogether.strikeUse
delinstead if the element is marking an edit, otherwise usesinstead.xmpUse
preandcodeinstead, and escape "<" and "&" characters as "<" and "&" respectively.basefontbigblinkcenterfontmarqueemulticolnobrspacertt-
Use appropriate elements and/or CSS instead.
Where the
ttelement would have been used for marking up keyboard input, consider thekbdelement; for variables, consider thevarelement; for computer code, consider thecodeelement; and for computer output, consider thesampelement.Similarly, if the
bigelement is being used to denote a heading, consider using theh1element; if it is being used for marking up important passages, consider thestrongelement; and if it is being used for highlighting text for reference purposes, consider themarkelement.See also the text-level semantics usage summary for more suggestions with examples.
The following attributes are obsolete (though the elements are still part of the language), and must not be used by authors:
-
charsetonaelements -
charsetonlinkelements Use an HTTP Content-Type header on the linked resource instead.
-
coordsonaelements -
shapeonaelements -
methodsonaelements -
methodsonlinkelements Use the HTTP OPTIONS feature instead.
-
nameonaelements (except as noted in the previous section) -
nameonembedelements -
nameonimgelements -
nameonoptionelements Use the
idattribute instead.-
revonaelements -
revonlinkelements Use the
relattribute instead, with an opposite term. (For example, instead ofrev="made", userel="author".)-
urnonaelements -
urnonlinkelements Specify the preferred persistent identifier using the
hrefattribute instead.-
acceptonformelements Use the
acceptattribute directly on theinputelements instead.-
nohrefonareaelements Omitting the
hrefattribute is sufficient; thenohrefattribute is unnecessary. Omit it altogether.-
profileonheadelements When used for declaring which
metaterms are used in the document, unnecessary; omit it altogether, and register the names.When used for triggering specific user agent behaviors: use a
linkelement instead.-
versiononhtmlelements Unnecessary. Omit it altogether.
-
usemaponinputelements -
longdesconiframeelements -
longdesconimgelements Use a regular
aelement to link to the description, or (in the case of images) use an image map to provide a link from the image to the image's description.-
lowsrconimgelements Use a progressive JPEG image (given in the
srcattribute), instead of using two separate images.-
targetonlinkelements Unnecessary. Omit it altogether.
-
schemeonmetaelements Use only one scheme per field, or make the scheme declaration part of the value.
-
archiveonobjectelements -
classidonobjectelements -
codeonobjectelements -
codebaseonobjectelements -
codetypeonobjectelements Use the
dataandtypeattributes to invoke plugins. To set parameters with these names in particular, theparamelement can be used.-
declareonobjectelements Repeat the
objectelement completely each time the resource is to be reused.-
standbyonobjectelements Optimize the linked resource so that it loads quickly or, at least, incrementally.
-
typeonparamelements -
valuetypeonparamelements Use the
nameandvalueattributes without declaring value types.-
languageonscriptelements (except as noted in the previous section) Use the
typeattribute instead.-
eventonscriptelements -
foronscriptelements Use DOM Events mechanisms to register event listeners. [DOMCORE]
-
datapagesizeontableelements Unnecessary. Omit it altogether.
-
summaryontableelements Use one of the techniques for describing tables given in the
tablesection instead.-
abbrontdandthelements -
Use text that begins in an unambiguous and terse manner, and include any more elaborate text after that. The
titleattribute can also be useful in including more detailed text, so that the cell's contents can be made terse. -
axisontdandthelements -
scopeontdelements -
Use
thelements for heading cells. -
datasrcona,applet,button,div,frame,iframe,img,input,label,legend,marquee,object,option,select,span,table, andtextareaelements -
datafldona,applet,button,div,fieldset,frame,iframe,img,input,label,legend,marquee,object,param,select,span, andtextareaelements -
dataformatasonbutton,div,input,label,legend,marquee,object,option,select,span, andtableelements Use script and a mechanism such as
XMLHttpRequestto populate the page dynamically. [XHR]-
alinkonbodyelements -
bgcoloronbodyelements -
linkonbodyelements -
marginbottomonbodyelements -
marginheightonbodyelements -
marginleftonbodyelements -
marginrightonbodyelements -
margintoponbodyelements -
marginwidthonbodyelements -
textonbodyelements -
vlinkonbodyelements -
clearonbrelements -
alignoncaptionelements -
alignoncolelements -
charoncolelements -
charoffoncolelements -
valignoncolelements -
widthoncolelements -
alignondivelements -
compactondlelements -
alignonembedelements -
hspaceonembedelements -
vspaceonembedelements -
alignonhrelements -
coloronhrelements -
noshadeonhrelements -
sizeonhrelements -
widthonhrelements -
alignonh1—h6elements -
alignoniframeelements -
allowtransparencyoniframeelements -
frameborderoniframeelements -
hspaceoniframeelements -
marginheightoniframeelements -
marginwidthoniframeelements -
scrollingoniframeelements -
vspaceoniframeelements -
alignoninputelements -
hspaceoninputelements -
vspaceoninputelements -
alignonimgelements -
borderonimgelements (except as noted in the previous section) -
hspaceonimgelements -
vspaceonimgelements -
alignonlegendelements -
typeonlielements -
compactonmenuelements -
alignonobjectelements -
borderonobjectelements -
hspaceonobjectelements -
vspaceonobjectelements -
compactonolelements -
alignonpelements -
widthonpreelements -
alignontableelements -
bgcolorontableelements -
borderontableelements -
bordercolorontableelements -
cellpaddingontableelements -
cellspacingontableelements -
frameontableelements -
rulesontableelements -
widthontableelements -
alignontbody,thead, andtfootelements -
charontbody,thead, andtfootelements -
charoffontbody,thead, andtfootelements -
valignontbody,thead, andtfootelements -
alignontdandthelements -
bgcolorontdandthelements -
charontdandthelements -
charoffontdandthelements -
heightontdandthelements -
nowrapontdandthelements -
valignontdandthelements -
widthontdandthelements -
alignontrelements -
bgcolorontrelements -
charontrelements -
charoffontrelements -
valignontrelements -
compactonulelements -
typeonulelements -
backgroundonbody,table,thead,tbody,tfoot,tr,td, andthelements Use CSS instead.