外部链接在我的网站中打开

时间:2016-12-18 02:03:40

标签: javascript html css

所以我遇到了一个令人困惑的问题。

当我使用这行代码时:

<li><a href="www.google.com" style="margin-right: 40px;">Donate</a></li>

该网站&#39; www.google.com&#39;使用以下网址在我的窗口或标签页中打开:https://gyazo.com/6f200273b542d4f91e202a85bc3bc725

如果我添加

,它会完全相同
target="_blank"

代码

有什么建议吗?

1 个答案:

答案 0 :(得分:1)

如上所述,您需要https://

<li>
  <a href="www.google.com" style="margin-right: 40px;">without https</a>
</li>

<li>
  <a href="https://www.google.com" style="margin-right: 40px;">with https</a>
</li>

<li>
  <a href="https://www.google.com" target="_Blank" style="margin-right: 40px;">https with target blank</a>
</li>

相关问题