当单击某个单词时,我想使用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>