I have this hyperlink code:
<a href="http://www.youtube.com/user/mamgrow"><img style="position:relative; float:right; height:30px; left:-30px;" alt="mamgrow facebook" src="images/facebook.png"/></a>
And I want this link to open in a new tab...
I tried to put this in:
style="target-new:tab;
But it didn't work. Any ideas?
The first method requires a keyboard and a mouse or trackpad. Simply press and hold the Ctrl key (Cmd on a Mac) and then click the link in your browser. The link will open in a new tab in the background.
You can make a HTML link open in a new tab by adding the target=”_blank” attribute. You should insert this after the link address.
Explanation: Here, target=”_blank” is used to open a hyperlink in a new tab.
To quickly open a link in a new tab on Google Chrome, hold down the control button while clicking on it with your mouse.
You can easily use the target
attribute like:
<a href="http://www.example.com" target="_blank"><img src="your/image" /></a>
If your user has a browser which support tabs, the linked page will opened at a new tab in the active browser window, if set so - mostly it is a default.
Nearly every browser supports this today. See this list on Wikipedia for detailed informations.
Here a list of the target
attribute properties in a <a>
tag in HTML:
target="_blank" <!-- opens link in a new window -->
target="_self" <!-- opens link in actual window -->
target="_parent"
target="_top" <!-- both handle frames -->
This part of your code:
style="target-new:tab;
has no effect, its seems to be not supported by any modern browser.
Reading the w3schools instructions explains that the syntax for opening a link in a new tab or window (depending on the settings in the web browser) you should add the attribute
target="_blank"
http://www.w3schools.com/html/html_links.asp
You should be using the following code to open in a new window
<a href="http://www.google.com" target="_blank">...</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With