【问题标题】:External Links Open Within My Website [duplicate]在我的网站中打开外部链接 [重复]
【发布时间】:2016-12-18 02:03:39
【问题描述】:

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

当我使用这行代码时:

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

网站“www.google.com”在我的窗口或标签页中打开,网址为:https://gyazo.com/6f200273b542d4f91e202a85bc3bc725

如果我添加它会做完全相同的事情

target="_blank"

代码也是

有什么建议吗?

【问题讨论】:

  • www之前需要http://
  • 你可能安装了一些浏览器插件,试试隐身寡妇?

标签: javascript html css


【解决方案1】:

正如上面 cmets 中提到的,您需要 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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多