问题
I am new to HTML 5 and I have problems to find out in the diverse W3 HTML standardization documents to obtain the status of an attribute.
For example, the bgcolor
attribute of the <body>
element should not be used any longer since HTML 4.01. It was deprecated. (see: http://www.w3.org/TR/html4/present/graphics.html#h-15.1.1).
However what is it's status in HTML 5? In the HTML markup specification that attribute is marked as obsolete (see: http://www.w3.org/TR/html-markup/body.html).
Does this mean by the book, the attribute does not exist any longer in HTML 5?
Considering writing a standard conform client, to which reference in the docs should I relate to to have precise and defined dealing for the attribute? Just drop it because it is obsolete? Leave it in there but otherwise being deaf about it (there is an attribute node but it has no meaning)?
Where is that documented in the standardization documents?
回答1:
If you are asking about what a user agent should do, for the case of bgcolor on the <body>
element, that's defined for HTML5 in the Rendering Section, where it says:
When a body element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy color value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'background-color' property to the resulting color.
来源:https://stackoverflow.com/questions/13439800/status-of-attributes-deprecated-or-obsolete