使用target属性指定在 html 中打开链接文档的目标。以下是目标属性的值 -
属性
描述
_blank
在新选项卡中打开链接页面。
self
在当前选项卡中打开链接页面。
parent
在父框架中打开链接页面。
顶部
在最上面的框架中打开链接页面。
示例您可以尝试运行以下代码来实现目标属性 -
<!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>
以上就是我们如何在html中指定打开链接文档的目标位置?的详细内容。