Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deprecated HTML elements still work

Tags:

html

tags

W3C has announced that several elements have become deprecated, such as <font>, <frameset> and <strong>, most of which can be replaced by CSS. This change was said to be brought about in HTML 5, however, if I put the HTML 5 doctype on a document these elements still seem to work. Am I unknowingly not actually applying the HMTL 5 doctype, or am I just completely misinterpreting the W3C's notice?

like image 299
Bluefire Avatar asked Jun 18 '26 22:06

Bluefire


2 Answers

The DOCTYPE does not determine what elements will be supported. If your browser supports an element, than the element will 'work'. Browsers support elements that are deprecated, because they have to work well when they are used to view old sites.

As a thought experiment, what do you think this code will do?

bluefire {
    display: block;
    padding: 1em;
    border: 2px solid black;
}

<bluefire>
    Hello world!
</bluefire>

The definition of whether or not elements 'work' is not clear cut.

like image 159
robertc Avatar answered Jun 21 '26 14:06

robertc


Deprecated in this case means that the features remain but their use may raise warning messages recommending alternative practices, and deprecation may indicate that the feature will be removed in the future.

Basically try not to use as there are better alternatives http://en.wikipedia.org/wiki/Deprecation

like image 22
AvengingBudda Avatar answered Jun 21 '26 15:06

AvengingBudda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!