HTML中的target标签的属性值

HTML中的target标签的属性值

target标签有四种不同的属性值

//跳转到新的文档页面,也就是打开新的目标文档
<a target = "_blank"></a>

//在当前页面进行跳转,是 a 标签的默认值
<a target = "_self"></a>

//以文档在父窗口上的方式跳转,如果父窗口是window对象的话,那么效果和_self相同
<a target = "_parent"></a>

//能够跳转出包含这个超链接的窗口
<a target = "_top"></a>

也可以设置当前文档对象所有a标签的跳转方式

只需要在当前文档对象的head标签中添加base标签

<html>
	//设置了当前文档中所有的 a 标签的跳转方式为跳转到新的页面
	<base target = "_blank">
</html>
<body>
</body>

猜你喜欢

转载自blog.csdn.net/qq_36949892/article/details/90449950