SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <a name="search"></a> up to date technique?

    Hello,

    I'm using
    Code:
    <a name="search"></a>
    so that users can reach a section of the page they're currently browsing.

    Is this technique ok? Is there something more clever to do in our day and age?


  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by jjshell View Post
    Hello,

    I'm using
    Code:
    <a name="search"></a>
    so that users can reach a section of the page they're currently browsing.

    Is this technique ok? Is there something more clever to do in our day and age?

    That's only useful for Netscape 4 and earlier. Most modern browsers no longer support it since there was a new way introduced into the standards back in 1997 and apart from Netscape all other browsers since that time have supported the newer way.

    Just add an id attribute to whatever tag you want to use as the destination of your link.

    For example if you want to jump to the div that contains the navigation then just use <div id="nav"> and then <a href="#nav">go to nav</a> will jump you straight to it.
    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="^$">

  3. #3
    SitePoint Member
    Join Date
    Aug 2011
    Location
    PH
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    That's only useful for Netscape 4 and earlier. Most modern browsers no longer support it since there was a new way introduced into the standards back in 1997 and apart from Netscape all other browsers since that time have supported the newer way.

    Just add an id attribute to whatever tag you want to use as the destination of your link.

    For example if you want to jump to the div that contains the navigation then just use <div id="nav"> and then <a href="#nav">go to nav</a> will jump you straight to it.
    I agree, the use of the id attribute has changed the name attribute and with HTML 5 who knows whats next.

  4. #4
    SitePoint Enthusiast tenfingers's Avatar
    Join Date
    May 2004
    Location
    Alberta, Canada
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by glennforum View Post
    I agree, the use of the id attribute has changed the name attribute and with HTML 5 who knows whats next.
    One thing is for sure: the name attribute on an anchor is obsolete in HTML5. (See, W3C HTML5 overview, 11 Obsolete features.)


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
  •