Link to location on another webapge

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

Thanks
kevinb4940Asked:
Who is Participating?
 
RouchieCommented:
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>
0
 
RouchieCommented:
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.
0
 
kevinb4940Author Commented:
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

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

Careers.php
<p id="linktarget01">
Doctors</p>

Thanks
0
 
kevinb4940Author Commented:
Sorry my mistake. It works now! Thanks 500 points are yours
0
 
SheharyaarSaahilCommented:
you can use an anchor point in your careers.php where you want the page to be loaded via index.php
like;

<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" />
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.