user1888478
user1888478

Reputation: 101

Unable to make a link open in a new tab using _blank

This is the code I am using for my link.

<a href="https://dribbble.com/jamesfrewin"><img class="socialicon" src="images/icons/dribbble_dark.png" onmouseover="this.src='images/icons/dribbble_pink.png'" onmouseout="this.src='images/icons/dribbble_dark.png'" alt="Follow on Dribbble" width="32" height="32"/>

I don't seem to be able to get it up open in a new tab I have tried putting

target="_blank" 

everywhere but nothing seems to work?

Upvotes: 0

Views: 217

Answers (2)

fejese
fejese

Reputation: 4628

You probably missing something then. This should work just fine (Firefox, Windows at least):

<a href="https://dribbble.com/jamesfrewin" target="_blank" id="foo">
  <img class="socialicon" src="images/icons/dribbble_dark.png"
     onmouseover="this.src='images/icons/dribbble_pink.png'"
     onmouseout="this.src='images/icons/dribbble_dark.png'"
     alt="Follow on Dribbble" width="32" height="32"
  />
</a>

By the way, you might want to start not to define all your event handlers inline but rather after the page is loaded.

Upvotes: 1

agrm
agrm

Reputation: 3842

You can try target="_newtab":

<a target="_newtab" href="https://dribbble.com/jamesfrewin"><img class="socialicon" src="images/icons/dribbble_dark.png" onmouseover="this.src='images/icons/dribbble_pink.png'" onmouseout="this.src='images/icons/dribbble_dark.png'" alt="Follow on Dribbble" width="32" height="32"/>

Upvotes: 2

Related Questions