0

If I am using a deprecated tag in my HTML document, but it is showing the same output, then what difference it make? For say

 <!doctype html>
   <html>
     <head>
       <meta charset="utf-8">
       <title>Ex</title>
     </head>
    <body>
      <center>
        <h1>Hello, This is center align text</h1>
       </center>
    </body>
  </html>

And I get <h1>tag as an center align text. So, when the output is same, I need to know in what means this deprecation is made?

Srija Nair
  • 219
  • 3
  • 12
  • possible duplicate of [Why is the
    tag deprecated in HTML?](http://stackoverflow.com/questions/1798817/why-is-the-center-tag-deprecated-in-html)
    – Manwal Dec 23 '14 at 12:49
  • 2
    @Manwal It's not a duplicate if you read the question well. It's about using deprecated tags and not why the tag is deprecated. – Sinan Samet Dec 23 '14 at 12:51
  • I read it already several times @SinanSamet – Manwal Dec 23 '14 at 12:55
  • I am not asking about the
    tag only, it is about all the tags which are deprecated, I just took the example of
    tag
    – Srija Nair Dec 23 '14 at 12:57

3 Answers3

1

That this functionality will drop from future browsers. If the processing of the element is stopped it won't center your markup.

Max
  • 336
  • 1
  • 12
1

The center tag was deprecated not in HTML5 but already been deprecated since HTML4. It simply carries the deprecated status over to HTML5 where it is now obsolete and non-conforming.

Ref: http://www.w3.org/TR/html4/present/graphics.html#edef-CENTER.

And this portion of the spec talks about deprecated elements: http://www.w3.org/TR/html4/conform.html#deprecated

A deprecated element or attribute is one that has been outdated by newer constructs. Deprecated elements are defined in the reference manual in appropriate locations, but are clearly marked as deprecated. Deprecated elements may become obsolete in future versions of HTML.... This specification includes examples that illustrate how to avoid using deprecated elements. In most cases these depend on user agent support for style sheets. In general, authors should use style sheets to achieve stylistic and formatting effects rather than HTML presentational attributes. HTML presentational attributes have been deprecated when style sheet alternatives exist.

There is no immediate risk in using a deprecated element. The user-agents should continue to support deprecated elements for reasons of backward compatibility.

However, The risk you take with using a tag which was deprecated in 1999, is that there may not be much time left when this gets from "deprecated" to "obsolete".

And from the ref above:

An obsolete element or attribute is one for which there is no guarantee of support by a user agent. Obsolete elements are no longer defined in the specification, but are listed for historical purposes

Important:

As of October-2014, the center tag is now obsolete and non-conforming in HTML5.

Ref: http://www.w3.org/TR/html5/obsolete.html#obsolete

The risk you take with using a tag which is obsolete and non-conforming, is simply that your website is well, obsolete and non-conforming. Also, any-time an update of a modern browser happens, it may render your website with presentational issues, unless proper doctype is included.

Summary:

While there is no difference, and may not be for some foreseeable future owing to backwards compatibility, it is better to start slowly phasing out such elements and that is what deprecated means (to wean). Where-ever possible, update the code to conform the latest spec.

.

Abhitalks
  • 27,721
  • 5
  • 58
  • 81
  • I found the HTML5 deprecated tag here : http://www.tutorialspoint.com/html5/html5_deprecated_tags.htm – Srija Nair Dec 23 '14 at 12:58
  • (1) What you are linking is not the official spec. The official specs are at W3c. (2) Yes, it *stays* deprecated in HTML5 but it was deprecated way before that and continues to remain deprecated in HTML5. – Abhitalks Dec 23 '14 at 13:01
  • 2
    @srijanair: Actually, it is no longer *deprecated* in HTML5. It is *obsolete* and *non-conforming*. – Abhitalks Dec 23 '14 at 13:06
  • 1
    @downvoter: Care to explain? Is there anything wrong? Is this answer not useful? – Abhitalks Dec 23 '14 at 16:19
  • The answer claims that browsers “can (and will in future) render your website with serious presentational issues”, without the slightest evidence. – Jukka K. Korpela Dec 23 '14 at 16:23
  • The last quotation is a misquotation. The URL mentioned does *not* contain such a statement. – Jukka K. Korpela Dec 23 '14 at 16:26
  • 1
    Thank you so much @JukkaK.Korpela. Much much appreciated. I did find that problem on second read. And the last quote was not mis-quote but mis-placed. I have tried to improve the answer. I hope this edit is better. Thanks again. – Abhitalks Dec 23 '14 at 16:32
  • 1
    Thank you @abhitalks for the answer I totally get it. Thank you so much. – Srija Nair Dec 26 '14 at 09:28
0

It makes no difference. Declaring something as deprecated, obsolete, wrong, or anathemata is just an expression of an opinion. It does not change a bit (literally) in browsers or other software.

Even though HTML 4 paints a dark picture of what might happen to deprecated elements and attributes, it just didn’t happen. And HTML5 simply declares many things “obsolete” (including things that are valid in HTML 4.01 Strict!), without making scary notes; au contraire, it specifies “suggested rendering”, which describes the effect of most “obsolete” features—partly even in more detail than any previous HTML specification did.

Of course it varies by element or attribute. The blink element went away, and so did basefont (which was even in official specs), but that’s about it. Since center is probably used on a billion web pages or more, it would be foolish to browser vendors to take extra measures to remove support to it. The worst that could happen is that the content is not centered any more, but why would they do that, especially when HTML5 more or less recommends continued support?

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390