无法使用_blank在新选项卡中打开链接

时间:2014-03-26 23:34:11

标签: html hyperlink

这是我用于链接的代码。

<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"/>

我似乎无法在我尝试过的新标签中将其打开

target="_blank" 

到处都是,但似乎什么都没有用?

2 个答案:

答案 0 :(得分:2)

您可以尝试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"/>

答案 1 :(得分:1)

你可能错过了一些东西。这应该工作得很好(至少是Firefox,Windows):

<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>

顺便说一句,您可能希望开始不在内联时定义所有事件处理程序,而是在页面加载后定义。