anchor names syntax

Discussion in 'HTML' started by Jeff Thies, Dec 31, 2004.

  1. Jeff Thies

    Jeff Thies Guest

    I have a series of links that reference anchors in the same page. Is it
    legal to have spaces in the names? Such things would never work in the
    url, but work here.

    ex:

    <a href="#section 1">jump to section 1</a>

    ....

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

    Jeff
    Jeff Thies, Dec 31, 2004
    #1
    1. Advertising

  2. Jeff Thies

    Eric Biller Guest

    Jeff Thies wrote:

    > I have a series of links that reference anchors in the same page. Is it
    > legal to have spaces in the names?


    Bad Style!
    Imagine someone who wants to bookmark this reference. Propably he won't
    experience problems with it (depends on the browser) but all spaces will be
    converted to %20. Never use spaces in identifier, names or references. Try
    to convert them to underscores if you need it.

    > Such things would never work in the url, but work here.


    You cannot say this in general. Sometimes spaces will be converted to %20
    sometimes not. I am not sure if it depends on the browser or server, but it
    depends.

    greetz
    Eric Biller
    Eric Biller, Dec 31, 2004
    #2
    1. Advertising

  3. Jeff Thies

    Jeff Thies Guest

    Eric Biller wrote:
    > Jeff Thies wrote:
    >
    >
    >>I have a series of links that reference anchors in the same page. Is it
    >>legal to have spaces in the names?

    >
    >
    > Bad Style!


    Illegal syntax or just bad style?



    > Imagine someone who wants to bookmark this reference. Propably he won't
    > experience problems with it (depends on the browser) but all spaces will be
    > converted to %20.



    It's a site map. Nobody is going to bookmark an anchor in a sitemap!

    Jeff


    Never use spaces in identifier, names or references. Try
    > to convert them to underscores if you need it.
    >
    >
    >>Such things would never work in the url, but work here.

    >
    >
    > You cannot say this in general. Sometimes spaces will be converted to %20
    > sometimes not. I am not sure if it depends on the browser or server, but it
    > depends.
    >
    > greetz
    > Eric Biller
    >
    Jeff Thies, Dec 31, 2004
    #3
  4. Jeff Thies

    Greg Schmidt Guest

    On Fri, 31 Dec 2004 15:24:52 GMT, Jeff Thies wrote:

    > Eric Biller wrote:
    >> Imagine someone who wants to bookmark this reference. Propably he won't
    >> experience problems with it (depends on the browser) but all spaces will be
    >> converted to %20.

    >
    > It's a site map. Nobody is going to bookmark an anchor in a sitemap!


    If it's a big site, and someone is interested in a certain subset of it,
    they might well bookmark the anchor to get them back to that area very
    quickly. I've never done it myself, but "never say nobody".

    --
    Greg Schmidt
    Trawna Publications http://www.trawna.com/
    Greg Schmidt, Dec 31, 2004
    #4
  5. On Fri, 31 Dec 2004 15:24:52 GMT, Jeff Thies <>
    wrote:

    > Eric Biller wrote:
    >
    >> Jeff Thies wrote:
    >>
    >>> I have a series of links that reference anchors in the same page. Is
    >>> it legal to have spaces in the names?

    >>
    >> Bad Style!

    >
    > Illegal syntax or just bad style?


    Illegal. A fragment identifier is still part of a URI, so it must conform
    to URI syntax. See
    <URL:http://www.zvon.org/tmRFC/RFC2396/Output/chapter4.html#sub1>.

    [snip]

    Mike


    Please trim irrelevant quoted text from your replies.

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Dec 31, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AC

    Anchor Names in ASP

    AC, Nov 14, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    5,387
    Jacob Yang [MSFT]
    Nov 17, 2003
  2. AC

    repost: Anchor Names in ASP

    AC, Nov 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    374
    George Durzi
    Nov 14, 2003
  3. James Mercola

    anchor "names" in empty table cells

    James Mercola, Aug 9, 2004, in forum: HTML
    Replies:
    7
    Views:
    1,304
    James Mercola
    Aug 10, 2004
  4. still just me

    CSS A (link-anchor) syntax question

    still just me, May 5, 2008, in forum: HTML
    Replies:
    8
    Views:
    771
    still just me
    May 8, 2008
  5. Randy Webb

    FAQ Proposed Anchor Names

    Randy Webb, Dec 19, 2006, in forum: Javascript
    Replies:
    5
    Views:
    120
    Randy Webb
    Dec 20, 2006
Loading...

Share This Page