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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Location
    Silicon Valley
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to create a link to another page, but with a slight catch

    I would like to create a link from one page to another.
    Easy - I know. But I would like that link to to take me to a certain part of the other page, specifically towards the bottom of the page.

    Is that possible to do? And if so, what are the different ways I can specify where in the page to go? (i.e. what are the parameters that I can play with)

    Thanks!

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    That's what named anchors are for. Let w3schools describe it:
    The name Attribute

    When the name attribute is used, the <a> element defines a named anchor inside a HTML document.

    Named anchor are not displayed in any special way. They are invisible to the reader.

    Named anchor syntax:
    Code:
    <a name="label">Any content</a>
    The link syntax to a named anchor:
    Code:
    <a href="#label">Any content</a>
    The # in the href attribute defines a link to a named anchor.
    Are you a Help Vampire?

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,720
    Thanks
    80
    Thanked 4,514 Times in 4,478 Posts
    Which means that your reference on the first page could look like:
    Code:
    <a href="someOtherPage.html?#bottom">Go to the bottom of that other page</a>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    New to the CF scene
    Join Date
    Nov 2009
    Location
    Silicon Valley
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks to you both!


  •  

    Posting Permissions

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