31 users online (1 members and 30 guests)  


  Results 1 to 9 of 9

Related

  1. Linking iframes in different page?    Forum: HTML Forum
    Replies: 1
  2. problem with linking a page    Forum: HTML Forum
    Replies: 5
  3. Linking to areas on a web page    Forum: HTML Forum
    Replies: 11
  4. page linking problem i believe    Forum: HTML Forum
    Replies: 14
  1. #1
    forager's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    4

    Linking within a page

    I am teaching myself HTML, using Notepad for this exercise.
    In a linking within a page exercise, I am writing html for a glossary, in which I am supposed to create links at the end of each definition to the top of the page, where there are upper case alphabetized letters that the user can click on to access the listings (data terms) within the glossary. (e.g., click on A to view all alphabetized entries beginning with A, etc.)
    From A-R, everything links properly; after that, however, clicking on any of the letters S-Z takes me to the same spot in the glossary (the first word in the data definition of the 2nd data term under "R". I should mention that each letter is properly identified in my coding. I used the letter R in my coding onl y for the listing(s) that began with R--no others.
    Here is the code, which linked the first entry for each letter in the glossary's alphabetized list to the corresponding upper case letter at the top of the page:
    (using A as an example)
    <a name="startA">absolute pathname</a> This coding successfully linked to
    <a href="#startA">A</a> which links the letter A at the top of the page to the named anchor in the glossary. (At least, it does A-R)
    I cannot find any anomalies in my coding--no missing, duplicated, or transposed characters. For hours, I rigorously scanned all the text in the file--not just my coding--for omissions and errors. I'm dumbfounded (hopefully not just dumb).
    The code at the end of each definition (A-Z), which links the user to the top of the page, works uniformly well:
    [a <href="#top">TOP</a> successfully links to:
    < name="top"></a> which is at the very top of the page.
    I appreciate any help.

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: Linking within a page

    Hey forager, Have you tried to make the link absolute

    Instead of
    <a href="#startA">Go to A</a>

    try
    <a href="http://www.yoursite.com/glossary.html#startA">Go to A</a>






    <a name="startA">A</a>

    may or may not help but like you I am grasping at straws.

    D
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    forager's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    4

    Re: Linking within a page

    Dave,
    Thanks. I'm very new at this; and I want to find out what I did wrong, so I don't repeat the mistake. Why would discrete multiple links--which I believe to be properly coded--point to the same entry? My mystification proves that I need a more solid understanding of the linking process. It's driving me batty.

  4. #4
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: Linking within a page

    Why dont you go ahead and attach the file so we can take a look.

    D
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  5. #5
    forager's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    4

    Re: Linking within a page

    Here is the .txt file. Because I didn't know what part of the document was causing the trouble, I didn't send excerpts from the suspect areas. I apologize if the file is long.
    Again, the trouble starts with clicking on the S-Z letters.
    Regards
    Attached Files Attached Files

  6. #6
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Linking within a page

    You've missed the # off the anchors on #startR, #startS, #startW and #startX
    I'm sure that'll fix it.

  7. #7
    forager's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    4

    Re: Linking within a page

    Thanks for the help. I should be more careful and consistent. It turned out, however, that the fault was not in my code but rather in my perception of how the page should work.
    I noted that the last entry of the glossary was visible on the page when I clicked on the "S". So as a test, I copied a large slice of the text to the end of the file, moved the closing tags to the end, and saved the file. I then tested the S-X links. They worked! Originally, I expected the links to always present the first entry in that category, irrespective of how many entries follow it in the glossary. (e.g., clicking on X would have presented only the entry XML at the top of the page, followed by a blank page, because XML was the only entry in the glossary under X.)
    Obviously, I was wrong. Again, thanks for the help.

  8. #8
    primeryder's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Location
    Kauai, Hawaii
    Posts
    10

    Re: Linking within a page

    Whenever you see the hyperlinks of a sitemap or link list all grouped up together as if it is one hyperlink, you can bet that you either missed a single # or a < or> bracket somewhere. I have done that many times. You just have to go in the code and look, which i admit is tedious. But don't feel bad because even veteran webmasters do this from time to time when we are in a hurry.

  9. #9
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Linking within a page

    Quote Originally Posted by forager
    Thanks for the help. I should be more careful and consistent. It turned out, however, that the fault was not in my code but rather in my perception of how the page should work.
    I noted that the last entry of the glossary was visible on the page when I clicked on the "S". So as a test, I copied a large slice of the text to the end of the file, moved the closing tags to the end, and saved the file. I then tested the S-X links. They worked! Originally, I expected the links to always present the first entry in that category, irrespective of how many entries follow it in the glossary. (e.g., clicking on X would have presented only the entry XML at the top of the page, followed by a blank page, because XML was the only entry in the glossary under X.)
    Obviously, I was wrong. Again, thanks for the help.
    If you want the pages to appear one letter at a time, you're going to have to script it - although some complex CSS utilising visibility: hidden might be possible.
    If you just want to ensure that the "Z" entries (or whichever the last used letter is) appear at the top, just ensure you have enough whitespace under the last entry to fill a whole page.



Tags for this Thread