在新标签或窗口中打开链接

是否有可能在新标签中打开a href链接而不是相同的标签?

 <a href="http://your_url_here.html">Link</a> 

您应该使用值_blank添加锚标记中的target属性。

例如:

 <a target="_blank" href="http://your_url_here.html">Link</a> 

您不应该打电话来决定链接是在新标签还是在新窗口中打开,因为最终该select应该由用户浏览器的设置完成。 有些人喜欢标签; 有些像新的窗户。

使用_blank会告诉浏览器使用一个新的标签页/窗口,这取决于用户的浏览器configuration以及它们如何点击链接(例如中间点击, Ctrl +单击或正常点击)。

将您的<a>元素的target属性设置为"_tab"

编辑:它的作品,但W3Schools说,没有这样的目标属性: http : //www.w3schools.com/tags/att_a_target.asp

编辑2:从我从中得出的意见。 设置目标为_blank将带你到一个新的标签或窗口(取决于您的浏览器设置)。 除了下面的一个之外,键入任何内容都会创build一个新的标签组(我不确定这些标签是如何工作的):

 _blank Opens the linked document in a new window or tab _self Opens the linked document in the same frame as it was clicked (this is default) _parent Opens the linked document in the parent frame _top Opens the linked document in the full body of the window framename Opens the linked document in a named frame 

您可以简单地通过设置target="_blank"来进行检查