41 users online (1 members and 40 guests)  


  Results 1 to 12 of 12

Related

  1. Open an URL with form in the middle...    Forum: HTML Forum
    Replies: 0
  2. Replies: 0
  3. table in middle of my html page    Forum: HTML Forum
    Replies: 1
  4. Replies: 3
  5. Changing link colors in middle of page    Forum: HTML Forum
    Replies: 1
  1. #1
    kimsmith's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2004
    Posts
    6

    Link to Middle of Page

    How can I set up a link that will start in the middle of a page?

  2. #2
    krak_d's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    166
    Hi kimsmith and welcome to the forums,

    is it a link from one part of a page on your site to another you are after or a page onLoad starting at a specific point?

    krak_d

  3. #3
    kimsmith's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2004
    Posts
    6
    It would be a link from another page. The top has some information about 1 dog and the bottom has information about another dog. I've got links set on 4 different sites linking back to this page. I was wondering if you can link to the middle of a page.

  4. #4
    krak_d's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    166
    Its not possible with html to link to the middle of a page on another site unless the anchors are in place first.
    However XML linking specifications known as XLink and Xpointer expand on current html-based links. eg. you can link to a place inside a document even if the author didnt create an id.

    A search on the subject may provide you with better info but im not sure how well supported it is.


    To jump within one site you need the following.

    The hyperlink text:

    HTML Code:
    <a href="yourpage.html#yourNamedAnchor">TEXT HERE</a>
    The anchor placed in your code where you want the link to jump to:

    HTML Code:
    <a name="yourNamedAnchor"></a>
    As long as the anchors are in place on the page you want to link to then you can set up a link to it!

    hope this helps.
    krak_d
    Last edited by krak_d; 06-18-2004 at 06:57 AM.

  5. #5
    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
    on the page you want opened in the middle you will need to insert the below code exactly at the position you would like the page opened at.

    HTML Code:
    <a name="#callitwhatyouwant"></a>
    your links should read

    HTML Code:
    <a href="http://www.yoursite.com/yourpage.html#callitwhatyouwant">link</a>
    Dave

  6. #6
    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
    you beat me

  7. #7
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there kimsmith,

    Try adding this code to the body tag of the page to which you are linking....
    Code:
    
    onload="location.href= '#foo'"
    ...then place this code in the appropriate position of your page...
    Code:
    <a id="foo"></a>
    coothead

  8. #8
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Old coothead is last again

  9. #9
    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
    Quote Originally Posted by coothead
    Old coothead is last again
    It is hard to keep up with the youngsters, Krak beats us every time

    ( I have no problem with that )

  10. #10
    kimsmith's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2004
    Posts
    6
    That worked great. I had the a name right but I was adding the link wrong. Thanks for your help.

  11. #11
    Geno_3245's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2010
    Posts
    1

    Re: Link to Middle of Page

    I am having a problem getting the code to work

    I want link on page1 to open at specific spot on page2

    On line 468 in page1
    I wrote: <a href="http://mysite/mypage.html#identifier">text</a>

    On line 367 of page2
    I wrote: <a name="#identifier"></a>

    The link takes me to page2, but it doesn't open at specific spot

    What am I doing wrong?

    Thanks

  12. #12
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Link to Middle of Page

    Hi there Geno_3245,

    and warm welcome to these forums.

    if you give us a link to the problematic site, we may possibly be able to assist you.



Tags for this Thread