Jump to content

[SOLVED] Hyperlink small image to Larger image


Recommended Posts

Hi there,

 

I was hoping for a little help if possible...Im building a gallery on my website and it has a number of small images. I need to make it so they are hyperlinked and when clicked will present a larger version of the image.

 

How is this done please??

 

Any help kindly appeciated

 

Thanks  :)

Hi there,

 

Thanks for the reply.. Im having little trouble with it....So far (using image i have called bar1.jpg)i have

 

<a href="bar1.jpg"><img src="bar1.jpg" />[/url]

 

For the URL what do i add there??

 

So far i have tried adding the URL to the page the small image is on....gallery.html....

 

Do i need to create a new page with the larger images on them>>>???

 

What am i doing wrong????

 

Usually im quite competant with html, but here little bit rusty...

 

Please help me

 

Thank you :)

The [/url] showed up because I didn't enclose it in code tags.  Please note that it should have been an end to the anchor tag as seen below.

 

To get rid of the underline for the link:

 

<a href="bar1.jpg" style="text-decoration:none"><img src="bar1.jpg" /></a>

 

or it would be much better to use it in a css using a class.

 

The style info needs to be in the <head> of your document.

<style="text/css">
.nolink {
    text-decoration:none;
}
</style>

<a href="bar1.jpg" class="nolink"><img src="bar1.jpg" /></a>

Yes you can change the color if you wanted.  You can also do this using a style sheet.  Please see http://www.w3schools.com/css/css_intro.asp for more info

Hi there,

 

Thank you for your help thats ACE! All seems to be working perfectly except for 1 minor detail...

 

 

any text underneath the hyperlink images is automatically hyperlinked to the last image????

 

I need to some how try to close the tags after?? tried </a> but to no luck...

 

Any ideas there??

 

Thank you :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.