parent在父框架中打开链接页面。 顶部在最上面的框架中打开链接页面。示例您可以尝试运行以下代码来实现目标属性 -<!DOCTYPE html><html> <head> <title&g" />
首页 > 文章列表 > 我们如何在HTML中指定打开链接文档的目标位置?

我们如何在HTML中指定打开链接文档的目标位置?

484 2023-09-13

使用target属性指定在 HTML 中打开链接文档的目标。以下是目标属性的值 -

< td style="width: 20.4193%; text-align: center;">parent

属性

描述

_blank

在新选项卡中打开链接页面。

self< /p>

在当前选项卡中打开链接页面。

在父框架中打开链接页面。

顶部

在最上面的框架中打开链接页面。

示例

您可以尝试运行以下代码来实现目标属性 -

<!DOCTYPE html>
<html>
   <head>
      <title>HTML target attribute</title>
   </head>
   <body>
      <h2>References</h2>
      <p>Refer the following <a href = "https://www.qries.com/questions.php" target = "_blank">website</a>.<br>
         The above link will open in a new tab.</p>
   </body>
</html>