Are image maps deprecated in (x)HTML?
问题:
回答1:
It is in the HTML 5 draft spec.
It also appears in the XHTML strict DTD:
<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
In short - it is part of both specs and is not deprecated.
Some people do not like image maps because they perceive them as not very accessible or discoverable, and as such there are other markup/css/javascript techniques that work better.
The map element doesn't appear in the obsolete
section of the HTML 5 spec either. In fact, several obsolete features have a recommendation to use image maps instead.
回答2:
For the record, it is also still part of XHTML1.1 Strict with one change
On the a and map elements, the name attribute has been removed in favor of the id attribute
In the now dead XHTML2 any element could have been an Image Map, effectively making a separate element for it superfluous, which is the reason it was no longer part of the specification.
回答3:
Image maps are still part of HTML 5.0, of HTML 5.1 and of HTML 5.2. The map
element was not listed in HTML 5.1's list of deprecated elements and is not listed in HTML 5.2's list of obsolete features.
(HTML 5.0 became an official W3C Recommendation in October 2014; HTML 5.1 became an official W3C Recmmendation on 1 November 2016.)