【发布时间】:2016-03-02 11:49:11
【问题描述】:
我的网站中有一个链接:
<a href="www.bff.org.uk">BFI</a>
这可能会出现在带有 URL 的页面上:
mysite.com/articles/60
点击链接会跳转到
mysite.com/articles/60/www.bff.org.uk
我知道将 http 添加到锚点可以解决此问题,但为什么 www 不访问该站点?有没有办法修复它,以便 www 链接进入该网站?
【问题讨论】:
-
是的,将 http:// 添加到开头。或保持相同的协议添加“//”,例如"//www.bff.org.uk"
-
Basically, any text in the href without a protocol is assumed to be a relative path if there is no / or protocol.- stackoverflow.com/questions/8997790/… 和 stackoverflow.com/questions/8951423/…。因为有很多不同的协议,所以必须定义一个。
标签: html