dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: links

  1. #1
    Join Date
    Dec 2002
    Location
    Leicester
    Posts
    6

    Question links

    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?

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    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...

  3. #3
    Join Date
    Dec 2002
    Location
    Leicester
    Posts
    6
    Pyro,

    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?

  4. #4
    Join Date
    Nov 2002
    Posts
    2,632
    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>

  5. #5
    Join Date
    Nov 2002
    Posts
    984
    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="">
    In most browsers you don't need to nest things in <a></a>.

    Eg <img id="closedloop" ...
    should work just as well.

  6. #6
    Join Date
    Nov 2002
    Posts
    2,632
    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.

  7. #7
    Join Date
    Dec 2002
    Location
    Leicester
    Posts
    6

    links

    Many thanks I will try that.

  8. #8
    Join Date
    Dec 2002
    Location
    Leicester
    Posts
    6

    links

    Again, many thanks.

    I tried it and it worked a treat

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles