小编pep*_*ito的帖子

使用html在同一选项卡中打开链接

我想在单击一个单词时用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>
Run Code Online (Sandbox Code Playgroud)

html

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

html ×1