Friday, November 06, 2009

Tech tips: HTML to open a link in a new window

Does it ever drive you a little crazy when you click on a link in a blog or website and instead of the link opening in a new window or tab, it opens on the same page/tab you were on?

From a different perspective, do you really want your blog visitors leaving your site altogether when they click on a link in one of your posts?

Your answer to the first might be "not really" or "what??," but your answer to the second should be "of course not!"

I have the answer for you, and it's really pretty easy.

Here is the piece of code that you need: target="_blank"

That's fine and dandy, but what do you do with this code?

When you're using Blogger (your blog has "blogspot" in the title, like mine), here's what you do:
  1. When you're writing a post, you see two tabs on the screen: "Edit HTML" and "Compose"
  2. You can write your post under "Compose" (it's a little easier), create your hyperlinks (highlight the text of the website you want to link to, then click the little planet button with a link on it, just to the right of the font color button and to the left of the left justification button
  3. When you're done with your post, don't publish it or schedule it yet; instead, go to "Edit HTML"
  4. Look for the text that you created a link for (it might be challenging to find if there's a lot of code in your post - I sometimes do a search for a keyword in the text so that I know exactly where it is)
  5. Before the text, you should see some HTML coding - if you're not familiar with what I'm talking about, it will be inside of carat symbols < >
  6. Here's a link that you'll see the coding for at the start of this post: My Etsy Shop
  7. If you click on the image above, you'll see it in a different page or tab
Before: < href=""> My Etsy Shop
After: < href="" target="_blank" > My Etsy Shop

You can do this in one fell swoop for your entire blog, but (frankly), I haven't figured out how or if I can do this with Blogger. If anyone does know how to do this, please share!

I hope this is helpful for you! If this doesn't make sense, let me know - and if it doesn't work, also please let me know!


Catherine Ivins said...

Thank you so much for this post Brenda- I've wondered about this- but never took the time to figure it out- thanks - can't wait to try it!

xo- Cat :)

Summer said...

Yes, I've wondered how to do this as well! Okay, anyone one Typepad that knows how to do this, please let me know! It should be standard...kind of a "duh" thing. :)