gpt4 book ai didi

html - w3c 验证器在 HTML 4.01 Strict 的图像映射上给出错误

转载 作者:太空宇宙 更新时间:2023-11-04 05:10:18 25 4
gpt4 key购买 nike

大家好, 我尝试使用 HTML 4.01 Strict 中的图像映射,但 w3c 验证器给我错误的 map 不支持,我的代码是这样的

<img id="link_image" src="images/livechat.png" usemap="#Map" alt="The chat link" />
<map name="Map" id="Map" class="newWindow link-chat" ><area shape="rect" coords="79,3,521,67" href="#" alt="The chat link mapping" /></map>

给出如下错误,

Line 57, Column 54: document type does not allow element "MAP" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag

最佳答案

Map 不能放在 body 标签内,而是放在 div 内(或错误消息中的备选方案之一),如下所示:

<div>
<img id="link_image" src="images/livechat.png" usemap="#Map" alt="The chat link" /
<map name="Map" id="Map" class="newWindow link-chat" ><area shape="rect" coords="79,3,521,67" href="#" alt="The chat link mapping"></map>
</div>

您还需要删除之前在其他答案中建议的不必要的 map 短标签。

关于html - w3c 验证器在 HTML 4.01 Strict 的图像映射上给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9480381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com