单击一个单词时,我想在与 html 相同的选项卡中打开一个链接。尽管如此,即使我尝试使用 target="_self
“ 并且不使用任何目标,它也只能与 target="_blank"
一起使用,但是,如您所知,这会在另一个选项卡中打开链接.
代码:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body
{
min-width:360px;
}
a{
color:#009900;
text-decoration:none;
}
a:hover
{
text-decoration:underline;
}
p
{
font:0.8em sans-serif;
}
h1
{
font:1.5em sans-serif;
color:#fff;
background:#006600;
padding:5px
}
</style>
</head>
<body>
<h1>play</h1>
<p><a href="https://www.youtube.com" target="_blank">YT player</a></p>
</body>
</html>
原文由 pepito 发布,翻译遵循 CC BY-SA 4.0 许可协议
使用
_self