Use above Custom Search to search for relevant topics

Saturday, November 10, 2007

Hyperlink open in new window or tab

In response to a blogger request, here is the HTML for a hyperlink that opens in new window and tag (that is, visitor will not lose your site):

<a href="target URL" target="_blank">anchor text</a>

or

<a href="target URL" target="new">anchor text</a>

NOTE:
1. target="....." has been deprecated and is not XHTML compliant and will give errors when you try to validate your website with
http://validator.w3.org/

This is because the people drafting the new standard feels that this should not be forced upon visitors but left to visitors to make a link open in the same or new window or tab (you can make a hyperlink open new window or new tab by right-clicking on a link and choosing either). But how many surfers know how to do that?

target="...." is still effective in many current browsers. Don't know about the future.

2. anchor text is the text that will be displayed by the browser. For example this is the HTML to the father of this blog which will soon be converted to custom domain:

<a href="URL" target="_blank">Blogger Tips and tricks</a>


and the browser will display it as

Blogger Tips and Tricks

Anchor text is important from the SEO (Search Engine Optimization) point of view. Refer to Importance of anchor text in hyperlinks.

3. Many webmaster feels that forcing visitors clicking on links in your site to open new windows or tabs is a wrong strategy and may discourage repeat visits, but this subject is controversial. Do your own research.

13 comments:

V.A.L.I.S said...

Thank you!

Stéphanie Cavaroc said...

Hi! I am trying to edit a Blogger template but the editor doesn't allow me to see the link list. It says "widget" b:widget id='LinkList4' Do you know how to customize template so the links open in new tab? Thanks...

Anonymous said...

This is really an excellent piece of knowledge- many thanks! :)

And what's up with W3 trying to phase target="", and have links open up in the same window? That completely does away with the leap forward that tabbed browsing provided for web navigation. I wonder what their thinking behind this is...

Anyway, thanks again for the tip.

SinnerSynx said...

anchor text

SinnerSynx said...

Nice man!! visit my Dota-Allstars Blog

SinnerSynx said...

Nice man!! visit my Dota-Allstars Blog

Syamil said...

Thanks a lot.

On the minus side, in IE, instead of opening in new tabs, the links open in new window.

I'd imagine the IE users wouldn't be very happy because that can be quite annoying to be honest.

I know IE is a pile a crap anyway, but any suggestions?

Cheers

Kiki said...

forgive me for being completely brand new to blogging, but i have no idea where to put the code!?! I've tried putting it in a few different places but to no avail! please help! thank you

Nirvana9 said...
This comment has been removed by the author.
Anees said...

thanks! i will use in my blog! http://www.learneveryone.com

Chaker :] said...

Awesome :] Thank you for this useful info!

ivan-fukuoka project said...

thanks for the handy tips!

Unknown said...

These tips are really excellent. Good work done. Keep it up..
Seo forum