SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to link to something further down a page

    I want to link to something further down one of my pages.
    For example:
    When you click on a link it jumps to a paragraph further down the page.

    How would i do this?

  2. #2
    SitePoint Zealot Mahz's Avatar
    Join Date
    Mar 2006
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="#identifier">CLICK HERE...</a>
    Code:
    <a name="identifier">...TO JUMP HERE</a>

  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Brilliant! Cheers mate!

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, you'll want to use the ID attribute instead of the NAME attribute.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Mahz View Post
    Code:
    <a href="#identifier">CLICK HERE...</a>
    Code:
    <a name="identifier">...TO JUMP HERE</a>
    Should be:

    Code:
    <a href="#identifier">CLICK HERE...</a>
    Code:
    <div id="identifier">...TO JUMP HERE</div>
    It doesn't have to be a div though, the id can be attached to any tag.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    Actually, you'll want to use the ID attribute instead of the NAME attribute.
    Good call to make that point, Dan. The old A NAME bit will work in current browsers, but it's either been officially deprecated or unofficially sent to purgatory (don't remember which and too lazy to look it up). A lot of HTML/design help sites tell visitors to use the old method. Keep striking a blow for current standards, dude!


Bookmarks

Posting Permissions

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