3

Possible Duplicate:
Open url in new tab using javascript

I'm trying to make it so that something opens up in a tab, not a window. As far as I can tell, this is set by browser preference. Is there no real way to override this? I understand you can use window.open, but is this subject to browser preference? I'm currently using target="_blank".

Community
  • 1
  • 1
Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

2 Answers2

1

You can do this with the following CSS:

a {
    target-name: new;
    target-new: tab;
}​​​​​​​​​​​​​

See this example (please not it does not work because jsFiddle does not support tabs. It is merely for demonstration purposes)

As simple one line solution:

<a href="http://www.bbc.com" target="new" style="target-name:new;target-new:tab">
    Text
</a>​
jacktheripper
  • 13,953
  • 12
  • 57
  • 93
0

For now, there is really no way for you to have it open in a new tab instead of a new window. It is, as you said, a browser preference.

As to jacktheripper's response. It looks like the target-name property is not supported in any major browser*.

*CSS3 target-name Property

magzalez
  • 1,396
  • 2
  • 14
  • 25