Reader Question: Can you have the “full size image” open in a new window?

by brentriggs on August 26, 2009

Print Post Print Post    

A reader asks:

First of all, thank you so much for all your help and answers to my past questions! On my blog when an image is put on a post, if you click on the image, it will open up to see a larger, closer view. This is great and I really appreciate that you can then see more details i the artwork that I do. However, is there a way where this can be done to open up into a new window? Like how you explained to add target=”_blank” to a link, so that it will open up in a new window. Can this be typed also into the images info on the HTML codes? Or is there some thing else that can be typed, so that this can be done?

Answer:

You can use “target=_blank” in ANY “<a>” tag no matter what the “<a>” tag encloses. You can wrap an image, text or other object in the “<a>” tag like this: <a href=”www.yourlink.com” target=”_blank”>Your text, image or object here</a>

Just put “target=_blank” anywhere in the opening “a” tag to cause it to open to new window. If you use Blogger to upload an image, they put a lot of long attributes into the whole string, but that doesn’t matter. As long as the “target=_blank” is somewhere in the opening “a” tag, it will work. Here’s samples from a Blogger upload, and then a more simple one from WordPress (which is also just plain old standard HTML except for the “mce_href” which is WordPress specific). Check them out…

Examples

Blogger Produced Code Using Blogger Upload:



WordPress and Standard HTML

0215099

Remember, you can link just about any object or piece of text in HTML. And if you can link it, the “target=_blank” will cause it to open in a new window.

Questions?

I would be very grateful if you
would share this with someone,
or put it on one of the social sites:

Bookmark and Share

Related Articles:

Print Post Print Post    

{ 5 comments… read them below or add one }

1 sandraraven15 September 9, 2009 at 5:51 am

Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

Reply

2 Andree August 27, 2009 at 4:00 am

Hi, Brent . . . just wanted you to know that “target=new” (no quotes of course) also works in every place I’ve used it. Even in flickr. Easier keystrokes. I never knew, tho, that you could put this anywhere within that first group of code! Thank you.

Reply

3 Maria@PersonalizedSketchesandSentiments August 26, 2009 at 8:00 pm

Wow! you are so quick!
Thank you for answering this! I am excited about trying it in my next post…

I do appreciate you answering my question in the midst of everything else you have going on!

Blessings & Aloha!
Maria

Reply

4 christina egner August 26, 2009 at 7:22 pm

Great tip. Is there away, so the photo can’t be clicked at all?

Reply

5 brentriggs August 27, 2009 at 7:18 am

Nothing can be “clicked” unless is it wrapped in the “” link tag… so if you have a photo that you don’t want to be clicked, go into the HTML, and delete the link tag before the image, everything between the opening and closing (): ““. Don’t forget to delete the closing tag: “

Reply

Leave a Comment

Previous post:

Next post: