Saturday, February 19, 2011

How do I have my Links Open In New Windows on my blog?

If you reference a lot of links to other blogs or websites like I do, you may want to have these links open in new windows. By doing this, it makes it convenient for your readers to view other web pages then return to your blog.You can also do the same with pictures that have links. Some experts think differently on opening links in new windows, please use your own judgement on what to do.

You can actually make all links within your blog open in a new window. Simply add a "<base target='_blank' />" to your blog, in the header.

Find
<head>

And change that to:
<head>
<base target='_blank' />

But please do this with discretion, especially if you have lots of links within your blog. You don't want your readers having to close a window each time they finish reading a linked article in your blog.

I usually code links to other websites or blogs individually so they open in new windows. If it's a link to my own content within my blog, I simply leave it alone.

Here is how you code a link to open in a  new window.

Below is a link that's going to open in the same window.

My Shop
Here is the source code for it.
<a href="http://www.etsy.com/shop/rjdesignhut%22%3EMy Shop</a>

Here is a link that's going to open in a new window.

My Shop
Now check out what's different here.
<a href="http://www.etsy.com/shop/rjdesignhut" target="_blank">My Shop</a>

It's so easy! I couldn't believe it myself the first time I did it.

It's the same with pictures.

Below is a picture with a link that's going to open in the same window.


<a href="http://www.etsy.com/listing/68200667/turquoise-pearl-bracelet-with-sterling" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="145" j6="true" src="http://ny-image3.etsy.com/il_570xN.217586439.jpg" width="200" /></a>

Now add the highlighted part and the picture will open in a new window.


<a href="http://ny-image0.etsy.com/il_570xN.217586468.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"><img border="0" height="149" j6="true" src="http://ny-image0.etsy.com/il_570xN.217586468.jpg" width="200" /></a>

Now here is a tip for you while you're browsing on the web. If you use Internet Explorer, right click on a link, by choosing between Open, Open in New Tab (older version of IE doesn't have this option) and Open in New Windows. You're totally in control how a new page will open, so don't forget to right click. When everything else fails, right click.

If you're still unsure whether you should have your links open in new windows, please check out some of the articles I found on the web.


Related Articles on the web:


Beware of opening links in a new window







1 comment:

  1. I had never heard of being able to have "all links within your blog open in a new window." I do each of my links separately like you do. Thanks for the info!

    ReplyDelete