Taylor Styles Taylor Styles - 1 year ago 97
HTML Question

Href while running localhost not working

so im designing a website using html, php, all that fun stuff & im trying to make facebook, twitter, youtube & instagram links that will open a new tab and take you to the website. but at the moment the URL is going to

instead of opening the new tab and THEN going to www.facebook.com.

heres my 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 href="www.twitter.com" target="_blank">
<img border="0" alt="twitter" src="img/twitter.png" width="50" height="50">

<a href="www.youtube.com" target="_blank">
<img border="0" alt="youtube" src="img/youtube.png" width="50" height="50">

<a href="www.instagram.com" target="_blank">
<img border="0" alt="instagram" src="img/instagram.png" width="50" height="50">
</div> `

and my css 'if' required.

.social {
position: fixed;
bottom: 0;
right: 7%;
width: 300px;


thanks in advance!

Answer Source

Try using a protocol like http:// or // to external links like this :

<a href="http://www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">

See this good answer on SO : http://stackoverflow.com/a/8951636/6028607

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download