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.

15 comments:

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

Thank you!

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

webmaster said...

In order to make money online in the best possible way, you need to figure out effective business strategies and we can help you with that. We, at Infinity Informations, are well known all over for providing efficient business solutions to our clients all over the world and as soon as you utilize our ecommerce solutions for the purpose of facilitating your online business, you would notice sudden and tremendous growth in your ecommerce venture. So, contact http://www.infyecommercesolution.com immediately and facilitate your online business.

roving-unit 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.

DotA-Allstars said...

anchor text

DotA-Allstars said...

Nice man!! visit my Dota-Allstars Blog

DotA-Allstars 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!

tanikota said...

thanks for the handy tips!

MLB2k11 said...

Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
SEO tools

sowmya said...

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