HTML <area> target 屬性
實例
帶有可點擊區域和target屬性的圖像映射:
<img src="planets.gif"
width="145" height="126"
alt="Planets"
usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun"
target="_blank">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun"
target="_blank">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
流覽器支持
所有主流流覽器都支持 target 屬性
定義和用法
target 屬性規定區域中連接的目標。
僅在使用了 href 屬性才使用 target 屬性。
HTML 4.01 與 HTML5之間的差異
不再支持 Frames 和 framesets 。 _parent, _top 和 framename 屬性值常用與 iframes中。
語法
<area target="_blank|_self|_parent|_top|framename">
屬性值
值 | 描述 |
---|---|
_blank | 在新窗口中打開被鏈接文檔。 |
_self | 默認。在相同的框架中打開被鏈接文檔。 |
_parent | 在父框架集中打開被鏈接文檔。 |
_top | 在整個窗口中打開被鏈接文檔。 |
framename | 在指定的框架中打開被鏈接文檔。 |