Link to location on another webapge

Posted on 2007-10-01
Medium Priority
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
  • 2
  • 2
LVL 25

Accepted Solution

Rouchie earned 2000 total points
ID: 19992533
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

Rouchie earned 2000 total points
ID: 19992559
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

ID: 19992769
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

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

Expert Comment

ID: 19992869
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

807 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