Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HTML internal links

Options
  • 08-02-2013 12:36pm
    #1
    Banned (with Prison Access) Posts: 13


    Hi,
    Trying to put internal links on a webpage - a FAQ page.
    Its on an OS Commerce platform.
    Have tried
    <a href="#XX">Here</a>
    <a name="XX"> Here</a>

    But just wont work.
    Links will bring you to homepage not the anchor further down the page
    Tagged:


Comments

  • Registered Users Posts: 1,144 ✭✭✭Ballyv24


    In your example, are you trying to link from <a href="#XX">Here</a> to the location of this on the same page: <a name="XX"> Here</a> ?


  • Registered Users Posts: 1,144 ✭✭✭Ballyv24


    I think I have found the issue that you are having. You may be working off an old HTML tutorial which says to link using the name attribute.

    Instead of name, use id.

    <a href="#XX">Here</a>

    That should link to:

    <div id="XX">
    You got here by clicking there
    </div>


  • Banned (with Prison Access) Posts: 13 Ron09


    Hi Ballyv24,
    Thanks for your help. Tried that but it still links back to home page and not to referenced text on the same page??


  • Registered Users Posts: 1,144 ✭✭✭Ballyv24


    Is the sample code that you included in your original post the code that you are testing on your site? If not, can you post an example of what you are currently using.

    Just so I can get my head around the issue.. You have a site with more than one page.. a home page and a faq page.

    On the faq page, you have a links on top of the page, and you want these to link to locations on the faq page ? But at the moment, when you click on these links, they redirect you to the home page of your site?


  • Banned (with Prison Access) Posts: 13 Ron09


    Snippet of html. Basically its an info page and I want the Shipping below to be a link that brings you to the Republic of Ireland section.
    <a href="#ROI">Shipping </a></br>

    <p><strong>Shipping Information</strong><br />

    <div id="ROI">Republic of Ireland </div></br>
    All order placed before 11am Monday – Friday (excluding Public Holidays) will qualify for next working day delivery.<br />


  • Advertisement
  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 2,588 Mod ✭✭✭✭KonFusion




  • Registered Users Posts: 1,144 ✭✭✭Ballyv24


    Ron09 wrote: »
    Snippet of html. Basically its an info page and I want the Shipping below to be a link that brings you to the Republic of Ireland section.
    <a href="#ROI">Shipping </a></br>

    <p><strong>Shipping Information</strong><br />

    <div id="ROI">Republic of Ireland </div></br>
    All order placed before 11am Monday – Friday (excluding Public Holidays) will qualify for next working day delivery.<br />

    That should work. Do you have to scroll to see the <div id="ROI">Republic of Ireland </div> section at the moment? To test it, make sure that the place that you are linking to is not visible from the link . In other words, add a load of <br>s to the page between the link and the div


  • Banned (with Prison Access) Posts: 13 Ron09


    Tried that but still no look.
    It is HTML code but its a .php page would that make a difference?


  • Registered Users Posts: 2,793 ✭✭✭oeb


    Ron09 wrote: »
    Tried that but still no look.
    It is HTML code but its a .php page would that make a difference?


    Does this happen in all browsers?

    Does the page change length after it first loads? Maybe products being pulled in with ajax?

    Can you provide a link to the page in question?

    Also, this appears to be a known issue with oscommerce, there are a few fixes here - http://forums.oscommerce.com/topic/73412-named-anchor-tags-dont-work/


Advertisement