{"id":238574,"date":"2023-12-26T09:52:26","date_gmt":"2023-12-26T01:52:26","guid":{"rendered":"https:\/\/www.idc.net\/help\/238574\/"},"modified":"2023-12-26T09:52:26","modified_gmt":"2023-12-26T01:52:26","slug":"html%e4%bb%a3%e7%a0%81-area-%e5%8c%ba%e5%9f%9f%e5%85%83%e7%b4%a0","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/238574\/","title":{"rendered":"Html\u4ee3\u7801: area &#8211; \u533a\u57df\u5143\u7d20"},"content":{"rendered":"<p><title id=\"html%e4%bb%a3%e7%a0%81-area-%e5%8c%ba%e5%9f%9f%e5%85%83%e7%b4%a0-WgAVUxtDlb\">Html\u4ee3\u7801: area - \u533a\u57df\u5143\u7d20<\/title><\/p>\n<h1 id=\"html%e4%bb%a3%e7%a0%81-area-%e5%8c%ba%e5%9f%9f%e5%85%83%e7%b4%a0-WgAVUxtDlb\">Html\u4ee3\u7801: area - \u533a\u57df\u5143\u7d20<\/h1>\n<p>\u5728HTML\u4e2d\uff0c<code>&lt;area&gt;<\/code>\u5143\u7d20\u7528\u4e8e\u5b9a\u4e49\u56fe\u50cf\u6620\u5c04\u4e2d\u7684\u53ef\u70b9\u51fb\u533a\u57df\u3002\u5b83\u5fc5\u987b\u5d4c\u5957\u5728<code>&lt;map&gt;<\/code>\u5143\u7d20\u4e2d\uff0c\u5e76\u4e14\u901a\u5e38\u4e0e<code>&lt;img&gt;<\/code>\u5143\u7d20\u4e00\u8d77\u4f7f\u7528\u3002<\/p>\n<h2 id=\"%e8%af%ad%e6%b3%95-WgAVUxtDlb\">\u8bed\u6cd5<\/h2>\n<p>\u4e0b\u9762\u662f<code>&lt;area&gt;<\/code>\u5143\u7d20\u7684\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<pre>\n<code>&lt;area shape=\"shape\" coords=\"coordinates\" href=\"url\" alt=\"text\"&gt;<\/code>\n<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li><code>shape<\/code>\u5c5e\u6027\u5b9a\u4e49\u4e86\u53ef\u70b9\u51fb\u533a\u57df\u7684\u5f62\u72b6\u3002\u5b83\u53ef\u4ee5\u662f\u4ee5\u4e0b\u503c\u4e4b\u4e00\uff1a<\/li>\n<ul>\n<li><code>default<\/code>\uff1a\u9ed8\u8ba4\u5f62\u72b6\uff0c\u901a\u5e38\u7528\u4e8e\u6574\u4e2a\u56fe\u50cf\u3002<\/li>\n<li><code>rect<\/code>\uff1a\u77e9\u5f62\u5f62\u72b6\uff0c\u9700\u8981\u4f7f\u7528<code>coords<\/code>\u5c5e\u6027\u6307\u5b9a\u5de6\u4e0a\u89d2\u548c\u53f3\u4e0b\u89d2\u7684\u5750\u6807\u3002<\/li>\n<li><code>circle<\/code>\uff1a\u5706\u5f62\u5f62\u72b6\uff0c\u9700\u8981\u4f7f\u7528<code>coords<\/code>\u5c5e\u6027\u6307\u5b9a\u5706\u5fc3\u5750\u6807\u548c\u534a\u5f84\u3002<\/li>\n<li><code>poly<\/code>\uff1a\u591a\u8fb9\u5f62\u5f62\u72b6\uff0c\u9700\u8981\u4f7f\u7528<code>coords<\/code>\u5c5e\u6027\u6307\u5b9a\u591a\u8fb9\u5f62\u7684\u9876\u70b9\u5750\u6807\u3002<\/li>\n<\/ul>\n<li><code>coords<\/code>\u5c5e\u6027\u5b9a\u4e49\u4e86\u53ef\u70b9\u51fb\u533a\u57df\u7684\u5750\u6807\u3002\u5177\u4f53\u7684\u5750\u6807\u503c\u53d6\u51b3\u4e8e<code>shape<\/code>\u5c5e\u6027\u7684\u503c\u3002<\/li>\n<li><code>href<\/code>\u5c5e\u6027\u5b9a\u4e49\u4e86\u70b9\u51fb\u533a\u57df\u540e\u8981\u8df3\u8f6c\u5230\u7684URL\u3002<\/li>\n<li><code>alt<\/code>\u5c5e\u6027\u5b9a\u4e49\u4e86\u5f53\u56fe\u50cf\u65e0\u6cd5\u663e\u793a\u65f6\u663e\u793a\u7684\u66ff\u4ee3\u6587\u672c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%a4%ba%e4%be%8b-WgAVUxtDlb\">\u793a\u4f8b<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528<code>&lt;area&gt;<\/code>\u5143\u7d20\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>\n<code>&lt;img src=\"map.jpg\" alt=\"Map\" usemap=\"#map\"&gt;\n&lt;map name=\"map\"&gt;\n  &lt;area shape=\"rect\" coords=\"0,0,100,100\" href=\"page1.html\" alt=\"Area 1\"&gt;\n  &lt;area shape=\"circle\" coords=\"150,150,50\" href=\"page2.html\" alt=\"Area 2\"&gt;\n  &lt;area shape=\"poly\" coords=\"200,200,250,250,200,300\" href=\"page3.html\" alt=\"Area 3\"&gt;\n&lt;\/map&gt;<\/code>\n<\/pre>\n<p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528<code>&lt;img&gt;<\/code>\u5143\u7d20\u663e\u793a\u4e86\u4e00\u4e2a\u540d\u4e3a<code>map.jpg<\/code>\u7684\u56fe\u50cf\uff0c\u5e76\u6307\u5b9a\u4e86\u66ff\u4ee3\u6587\u672c\u4e3a<code>Map<\/code>\u3002\u7136\u540e\uff0c\u6211\u4eec\u4f7f\u7528<code>&lt;map&gt;<\/code>\u5143\u7d20\u5b9a\u4e49\u4e86\u4e00\u4e2a\u540d\u4e3a<code>map<\/code>\u7684\u56fe\u50cf\u6620\u5c04\u3002\u5728<code>&lt;map&gt;<\/code>\u5143\u7d20\u5185\u90e8\uff0c\u6211\u4eec\u4f7f\u7528\u4e86\u4e09\u4e2a<code>&lt;area&gt;<\/code>\u5143\u7d20\u6765\u5b9a\u4e49\u4e09\u4e2a\u53ef\u70b9\u51fb\u533a\u57df\u3002\u7b2c\u4e00\u4e2a\u533a\u57df\u662f\u4e00\u4e2a\u77e9\u5f62\uff0c\u5de6\u4e0a\u89d2\u5750\u6807\u4e3a<code>0,0<\/code>\uff0c\u53f3\u4e0b\u89d2\u5750\u6807\u4e3a<code>100,100<\/code>\uff0c\u70b9\u51fb\u540e\u8df3\u8f6c\u5230<code>page1.html<\/code>\u3002\u7b2c\u4e8c\u4e2a\u533a\u57df\u662f\u4e00\u4e2a\u5706\u5f62\uff0c\u5706\u5fc3\u5750\u6807\u4e3a<code>150,150<\/code>\uff0c\u534a\u5f84\u4e3a<code>50<\/code>\uff0c\u70b9\u51fb\u540e\u8df3\u8f6c\u5230<code>page2.html<\/code>\u3002\u7b2c\u4e09\u4e2a\u533a\u57df\u662f\u4e00\u4e2a\u4e09\u89d2\u5f62\uff0c\u9876\u70b9\u5750\u6807\u5206\u522b\u4e3a<code>200,200<\/code>\u3001<code>250,250<\/code>\u548c<code>200,300<\/code>\uff0c\u70b9\u51fb\u540e\u8df3\u8f6c\u5230<code>page3.html<\/code>\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-WgAVUxtDlb\">\u603b\u7ed3<\/h2>\n<p><a href=\"https:\/\/idc.net\">\u540e\u6d6a\u4e91<\/a>\u662f\u4e00\u5bb6\u63d0\u4f9b\u9999\u6e2f\u670d\u52a1\u5668\u3001\u7f8e\u56fd\u670d\u52a1\u5668\u548c\u4e91\u670d\u52a1\u5668\u7684\u4e91\u8ba1\u7b97\u516c\u53f8\u3002\u5728HTML\u4e2d\uff0c<code>&lt;area&gt;<\/code>\u5143\u7d20\u7528\u4e8e\u5b9a\u4e49\u56fe\u50cf\u6620\u5c04\u4e2d\u7684\u53ef\u70b9\u51fb\u533a\u57df\u3002\u5b83\u53ef\u4ee5\u5d4c\u5957\u5728<code>&lt;map&gt;<\/code>\u5143\u7d20\u4e2d\uff0c\u5e76\u4e14\u901a\u5e38\u4e0e<code>&lt;img&gt;<\/code>\u5143\u7d20\u4e00\u8d77\u4f7f\u7528\u3002\u901a\u8fc7\u8bbe\u7f6e<code>shape<\/code>\u5c5e\u6027\u548c<code>coords<\/code>\u5c5e\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e0d\u540c\u5f62\u72b6\u7684\u53ef\u70b9\u51fb\u533a\u57df\u3002\u70b9\u51fb\u533a\u57df\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>href<\/code>\u5c5e\u6027\u6307\u5b9a\u8df3\u8f6c\u7684URL\u3002\u5982\u679c\u56fe\u50cf\u65e0\u6cd5\u663e\u793a\uff0c\u53ef\u4ee5\u4f7f\u7528<code>alt<\/code>\u5c5e\u6027\u63d0\u4f9b\u66ff\u4ee3\u6587\u672c\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u4f7f\u7528\u56fe\u50cf\u6620\u5c04\u6765\u521b\u5efa\u53ef\u70b9\u51fb\u533a\u57df\uff0c\u53ef\u4ee5\u4f7f\u7528HTML\u4e2d\u7684<code>&lt;area&gt;<\/code>\u5143\u7d20\u6765\u5b9e\u73b0\u3002\u8bf7\u53c2\u8003\u4e0a\u9762\u7684\u793a\u4f8b\u548c\u8bed\u6cd5\uff0c\u6839\u636e\u60a8\u7684\u9700\u6c42\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<p>\u4e86\u89e3\u66f4\u591a\u5173\u4e8e<code>&lt;area&gt;<\/code>\u5143\u7d20\u7684\u4fe1\u606f\uff0c\u8bf7\u8bbf\u95ee<a href=\"https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/HTML\/Element\/area\" rel=\"nofollow noopener\" target=\"_blank\">MDN \u6587\u6863<\/a>\u3002<\/p>\n<h3 id=\"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a6%96%e9%80%89%e5%90%8e%e6%b5%aa%e4%ba%91-WgAVUxtDlb\">\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91<\/h3>\n<p>10\u5143\u9999\u6e2f\u670d\u52a1\u5668<\/p>\n<p>\u9999\u6e2f\u670d\u52a1\u5668\u514d\u8d39\u8bd5\u7528<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Html\u4ee3\u7801: area - \u533a\u57df\u5143\u7d20 Html\u4ee3\u7801: area - \u533a\u57df\u5143\u7d20 \u5728HTML\u4e2d\uff0c&lt;area [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197854],"tags":[],"class_list":["post-238574","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=238574"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238574\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=238574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=238574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=238574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}