所以我正在使用 html、php 所有有趣的东西设计一个网站,并且我正在尝试制作 facebook、twitter、youtube 和 instagram 将打开新标签页的链接并带你到网站。但目前 URL 转到 localhost/horizonphotography/www.facebook.com
而不是打开新选项卡然后转到 www.facebook.com
。
这是我的 HTML
<div class="social">
<a href="www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">
</a>
<a href="www.twitter.com" target="_blank">
<img border="0" alt="twitter" src="img/twitter.png" width="50" height="50">
</a>
<a href="www.youtube.com" target="_blank">
<img border="0" alt="youtube" src="img/youtube.png" width="50" height="50">
</a>
<a href="www.instagram.com" target="_blank">
<img border="0" alt="instagram" src="img/instagram.png" width="50" height="50">
</a>
</div>
和我的 css 'if' 需要。
.social {
position: fixed;
bottom: 0;
right: 7%;
width: 300px;
}
提前致谢!
最佳答案
尝试使用像 http://
或 //
这样的协议(protocol)来连接这样的外部链接:
<a href="http://www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">
</a>
在 SO 上看到这个很好的答案:https://stackoverflow.com/a/8951636/6028607
关于html - 运行 localhost 时 Href 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36674458/