Are image maps deprecated?

2019-01-27 12:45发布

Are image maps deprecated in (x)HTML?

标签: html xhtml html5
3条回答
Deceive 欺骗
2楼-- · 2019-01-27 13:08

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.)

查看更多
萌系小妹纸
3楼-- · 2019-01-27 13:18

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.

查看更多
欢心
4楼-- · 2019-01-27 13:22

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.

查看更多
登录 后发表回答