SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    anchor not working

    There must be something obvious that I'm missing. The links at the top of the page content (Unwanted hair, etc.) re not working with the anchors below. The page is: Med Spa | Essencials Day Spa Lenox Berkshires MA
    What am I missing?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Instead of this:

    Code:
    <a href="/pkmedispa_v2.html/#hair">Unwanted hair</a>
    your link should simply be

    Code:
    <a href="#hair">Unwanted hair</a>
    Then remove the anchor around the H2 (which is invalid anyway)

    Code:
    <a name="hair"><h2>Unwanted hair</h2></a>
    and do this instead:

    Code:
    <h2 id="hair">Unwanted hair</h2>
    Hope that makes sense.

    EDIT:
    The quick solution is just to remove the red bit from this link:

    Code:
    <a href="/pkmedispa_v2.html/#hair">Unwanted hair</a>
    but using <a>s on the target is outdated anyway, and also you'd have to put the anchor inside the H2—rather than outside it—for the code to be valid HTML. So you may as well go the whole hog and do the whole thing the modern way.

  3. #3
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! Many thanks. Works fine now on the first link. I'll work on the others.
    Paul C.
    ClickBasics
    http://www.clickbasics.com


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
  •