Link to location on another webapge

Posted on 2007-10-01
Last Modified: 2010-04-09
On my website I have 2 pages, Index.php & careers.php

How Do I link from index.php to a specific spot on my career.php page? (ie: Half way down my careers.php page

Question by:kevinb4940
    LVL 25

    Accepted Solution

    Hi kevinb4940,

    The newest way to achieve this using XHTML-compliant methods is as follows:

    Create the object on the destination page that you wish to link to (i.e. a heading is used in my example), and give it an ID property with a unique name:

       <h1 id="linktarget01">Some Title</h1>

    Then on the first page (index.php) create a hyperlink like this:

      <a href="careers.php#linktarget01">Go to my link target</a>
    LVL 25

    Assisted Solution

    Just to expand and provide you with extra know-how, the unique object name is required because you can only link to one object from one link (...obvious!).  The hyperlink has the # symbol to indicate that you are linking to the object identified on the target page after the # symbol.

    So basically the destination object can be anything (an image, flash movie, whatever), but it must have the same ID="....." as the target link on the previous page.

    Author Comment

    Thanks I understand that. however I am linking from an image map on index.php to careers.php
    Is the syntax below correct? I tried this without any luck

    <map name="Map" id="Map"><area shape="rect" coords="0,117,84,137" href="/careers.php#linktarget01" />

    <p id="linktarget01">


    Author Comment

    Sorry my mistake. It works now! Thanks 500 points are yours
    LVL 65

    Expert Comment

    you can use an anchor point in your careers.php where you want the page to be loaded via index.php

    <a name="location"></a> your text here

    then in your index.php, give the link as follows;

    <map name="Map" id="Map"><area shape="rect" coords="0,117,84,137" href="/careers.php#location" />

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now