English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML: <area> target 属性

target属性指定在何处打开链接的文档,仅当存在href属性时使用。

 HTML <area> Tag

在线示例

具有可点击区域和目标属性的图像地图:

!DOCTYPE html>
<html>
<title>HTML:<area> target 属性 - 基础教程网 oldtoolbag.com</title>
<body>
<p>单击太阳以近距离观察它:</p>
<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.html" alt="Sun" target="_blank">
  <area shape="circle" coords="90,58,3"href="mercur.html" alt="Mercury">
  <area shape="circle" coords="124,58,8"href="venus.html" alt="Venus">
</map>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the target attribute

Definition and Usage

The target attribute specifies where to open the linked document.

Use only when the href attribute exists.

HTML 4.01 with HTML5differences

Frames and framesets are no longer supported. The _parent, _top, and framename attribute values are usually used with iframes.

Syntax

<area target="_blank|_self|_parent|_top|framename">

Attribute Value

ValueDescription
_blankOpen the linked document in a new window.
_selfDefault. Open the linked document in the same frame.
_parentOpen the linked document in the parent frame set.
_topOpen the linked document in the entire window.
framenameOpen the linked document in the specified frame.

 HTML <area> Tag