I am trying to prove that you can teach an old dog new tricks by teaching myself html at the age of 70.
My proposed web site has several pages.
The main page has text and other pages have images in the form of a series of tables where successive images appear to the left and the right.
I have set up links from the text page to the image pages but cannot find out how to link to a specific image rather than just the page.
Is this possible using tables and if so how do I do it please?
I'm not sure exactly what you mean, but if you want to link directly to an image this is the code you use <a href="img.jpg">open image</a>
If that isn't what you want, explain further, and we'll get you going...
Thanks for the reply which does not seem to be what I want.,
although I may be misunderstanding you.
I have a page called MAIN TANK.html and have added a link to the page called EQUIPMENT.html as follows
<A HREF="EQUIPMENT.html">closed loop<A>
This link takes me to the page Equipment but not to the specific image "closed loop" which is one of many images on that page. I want the link to go directly to the image concerned to save the reader having to scroll through a whole page and losing interest.
What other code should I be adding?
First of all, it's considered a good habit to give all of your HTML pages names in lower case.
Second, create a anchor by where you want the link to go to, ie <a name="closedloop"><img src="closedloop.jpg" alt=""> When you want to link to that specific area, use this as the link <a href="equipment.html#closedloop">Closed Loop</a>
In most browsers you don't need to nest things in <a></a>.
Originally posted by spufi
Second, create a anchor by where you want the link to go to, ie <a name="closedloop"><img src="closedloop.jpg" alt="">
Eg <img id="closedloop" ...
should work just as well.
Just after I posted, I thought what I typed was incorrect, or at least slightly wrong. I didn't have time to double check it. When I tried to do something like it before it didn't work. A book showed it as how I posted it, and it worked. Granted it was the name attribute. I'll see if it works with the id one instead.
Many thanks I will try that.
Again, many thanks.
I tried it and it worked a treat
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)