Deprecated Tags and Attributes in HTML

In this tutorials I’ll give an explanation about the deprecated tags and attributes with new versions of HTML. We will understand why and what to use in exchange of these tags and attributes. As is known to many, HTML 5 was released some time ago.  Along came the uproar about the new features, functionality and features which became agenda of many articles, websites, projects and even new businesses.

Parallel to this, and sort of indirectly some changes have undergone into programming. Some of these changes also involved the removal of the base HTML language: their tags. Everything you need to know after the understanding of web protocols, the internal function of language is the correct usage of HTML tags, to develop a simple web page.

Just like in any large language, the evolution of the HTML was backed with the deprecation too. Deprecation of specifications, concepts, practices and, in the case of HTML, it was tags. This tutorial aims to explain a bit about some tags and their attributes that have deprecated with the emergence of new releases, as well as understand why this happened, substitute resources, etc.

Obsolete Tags in HTML

Check out the  Table 1 , which contains a listing of some tags with description and explanation of what happened after deprecation.

Tags DeprecatedDescriptionTag Substitute
<applet>Inserts an applet page<object>
<basefont>Sets the font stylesCSS font styles
<center>Centralizes the elements internal to the tagCSS style. Ex: “text-align: center”
<dir>List of directories<ul>
<u>UnderlineUse CSS text styles
<strike> and <s>Strikes the text wrappedUse CSS text styles
<font>Set font style for the text wrappedCSS font styles
<isindex>Adds search field<form>
<menu>List of menus<ul>
<acronym>Creates an abbreviation with hint of what it means<abbr>

Table 1: List of tags and their deprecated replacement

Note that two values ​​in the same table were marked red. See below why:

  • <u> Tag: A tag u, coming from underline, and acted in the text in order to emphasize it was undervalued in view of the confusion that some users had when they saw compared to a hyperlink, for example. This is redundant compared to the use of the CSS to this, since there is still the possibility to use it with style effects.
  • <font>: This tag was disabled already a long time back and is regarded as an “anti-tag”, because their use violates the precepts of style with CSS. However, it is still very common to use the same old pages or mainly for users who do not feel comfortable using CSS for it.

For all other cases, it is too easy to identify the reason for the replacement or even abolition.

  • The tag <center> eg is routinely called “lazy tag” because it is widely used to centralize elements when they should have such an effect applied via a CSS style. The new specification is deprecated its effect, including using it in conjunction with a table (<table>) for aligning the same and their respective internal elements.
  • Along with this, the element <table> also happens to not be used to align forms or other elements in a HTML page, feature hitherto widely used by designers and web developers. You can no longer view such components without the edges of the rows and columns to achieve the organization . For this purpose, it is necessary the use of divisions (<div> ‘s) combined with the CSS styles.
  • Some other tags that make too meaningless or a scope too obsolete to the reality of the web today, such as <dir> and <acronym>. Particularly, <marquee> tag should have already entered the list as well, effects of of which can be obtained through JavaScript libraries or even plugins like Flash or Silverlight.

Obsolete Attributes in HTML

As much as many deprecated HTML tags, in larger quantities too many HTML attributes were also deprecated.  Check in Table 2 a list of attribute values ​​for HTML tags that went “down the drain”.

Attributedeprecated in tag (s):
aligncaption, iframe, img, input, object, legend, table, hr, div, h1, h2, h3, h4, h5, h6, p, col, colgroup, tbody, td, tfoot, th, thead, tr
rev, charseta, link
shape, cordsa
alink, link, textvlink, body
backgroundbody
clearbr
char, charoffcol, colgroup, tbody, td, tfoot, th, thead, tr
colorbasefont, font
borderimg, object
hspacevspace, img, object
linkbody
noshadehr
nowraptd, th
typeli, ul
valueread
vlinkbody
widthhr, table, td, th, col, colgroup, pre
vspaceimg, object

Table 2: Table of obsolete attributes in HTML 5

All these attributes can be replaced by obsolete controls using style sheet. Most can simply be connected directly to the stylesheet. For example, the test element # added to each page has certain attributes pre-defined style sheet common to all major pages, as in Listing 1 .

Listing 1: Example of standard CSS for all pages

#test {vertical-align:middle; margin:25px; width:29; height:31; border:none;}

<td width=”?”… /> for example, is also no longer allowed, you can apply this style using CSS .

Summary

To preserve compatibility and for the sake of customer satisfaction, many browser vendors provide support elements deprecated. But this can not happen forever, as can be observed in other languages, such as Java,. Net, etc.. The general recommendation is to try other ways of achieving, where possible, their effects always updating your code.

Comments

comments

About Manisha Patil

Manisha S Patil, currently residing at Pune India. She is currently working as freelance writer for websites. She had earlier worked at Caritor Bangalore, TCS Bangalore and Sungard Pune. She has 5 years of experience in Java/J2EE technologies.

Speak Your Mind

*