所以我设计一个网站使用HTML,PHP,所有有趣的东西和我试图制作Facebook,Twitter,youtube和instagram链接,将打开一个新的选项卡,并带你到网站.但目前网址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>
Run Code Online (Sandbox Code Playgroud)
和我的CSS '如果'需要.
.social {
position: fixed;
bottom: 0;
right: 7%;
width: 300px;
}
Run Code Online (Sandbox Code Playgroud)
提前致谢!
尝试使用像这样的协议http://或//外部链接:
<a href="http://www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">
</a>
Run Code Online (Sandbox Code Playgroud)
在SO上看到这个好答案:https://stackoverflow.com/a/8951636/6028607