Tuesday, May 15, 2012

Making links open in new tabs or windows

Two posts in one night! But I wanted to share this great tip that I came across.

I've noticed that some bloggers are able to make their links pop up in a new tab or window, and wondered "How did they do that?!" I think it's a very helpful feature (prevents a lot of back-and-forthing when there are multiple links I want to check out).

Tonight I finally decided to google the question, and after reading several not-so-helpful posts, I came across this one. I tried it, and it works. Just click on the link and see!

Edited to add: "head" appeared very close to the top of the HTML template page on mine (line six to be exact). 
Okay, not sure why, but I could not do "head" inside the little greater than and less than symbols (< >), like it appears in the how-to-link instructions. It disappeared every time I hit the publish button (3 times, in case you're wondering). What's up with that? Obviously I can follow instructions, but I can't write them. hahaha

6 comments:

Mari said...

I'm impressed! I can't even find the "head" part in my HTML.

The Bug said...

What a cool tool! I'll have to see if I can do it tonight (my work computer has weird blocks so it's hard to do HTML stuff on it).

skoots1mom said...

done!
great info, thanks!

JonMagic said...

Gah, it dropped the closing code tag that looks like this < / code > again remove the spaces.

JonMagic said...

It won't let you do html code in a blog post unless you wrap it in code tags. That would look like this < code > code you want to display < / code > ; but you have to remove the spaces (I put them there so this comment would render).

But anyways, that is probably not the best way to send links to a new tab. When you link something up in your blog post does it give you the option of setting a target on that specific link? Normally when you add a link it will have something like "Title", "Url", and "Target"... You can set the target there to _blank and it will do the desired action without modifying the head tag.

I don't recommend modifying the head tag because now EVERY link on your page opens in a new tab. If that is the intended behavior I guess it is fine but I have never seen someone do that in my 15+ years working on websites.

Also, my mom is becoming a geek!

JonMagic said...

I blame the epic comment fail on this awful internet at my hotel in Verona. Sorry for spamming your comments :(