Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts

    linking to a section of a page through another page?

    Okay i have these:

    <a href="#1">balh blah</a>

    and later

    <a name="1"></a>

    in my page.


    How do i link to the <a name="?"></a> through another page?

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    <a href="page.html#1">link</a>

    ... in page.html:

    <a id="1">...</a>

    It's best to use id instead of name as name is now deprecated.

  • #3
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    i can change that no problem.

    but, how do i link form page2.html to page1html at the id="1" section in page1.html?

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    look above you again...

    page1.html:

    <a href="page2.html#one">link</a>

    page2.html:

    <div id="one">
    This is the section of the page you want to link to.
    </div>

    I think I also read somewhere you couldn't use numbers for ids or classes, but I could be very wrong on that... hope this works,

  • #5
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    I'll try that out but will need some retooling as the section that needs to linked into is in a table and linking to the div will only bring it into the start of the div. But I'll tool around with it and see whati can come up with.

    gracias

  • #6
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    you can change the "div" to whatever you need. In other words, <a href="page.html#whatever"> will link to whatever element has the id "whatever."

  • #7
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    Good thing your on Richard. Sometimes I just need to have things spelled out for me. It only occured to me after reading that and on the can that i can use use a <div...></div>just to define a position in a page. This will be way too easy to implement if they ask for anything that i feel is way too much work otherwise.

    Thanks again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •