quick syntax question

Discussion in 'HTML' started by Ian Davies, Jun 17, 2006.

  1. Ian Davies

    Ian Davies Guest

    whats the syntax for a link to a bookmark on a page FROM A SEPARATE PAGE

    thanks
    ian
    Ian Davies, Jun 17, 2006
    #1
    1. Advertising

  2. Ian Davies

    Sid Ismail Guest

    On Sat, 17 Jun 2006 09:43:20 GMT, "Ian Davies" <>
    wrote:

    : whats the syntax for a link to a bookmark on a page FROM A SEPARATE PAGE


    "The NAME attribute defines a destination for a link. For example, a
    document containing..."

    Quick - get here for the rest:
    http://www.htmlhelp.com/reference/html40/special/a.html

    Sid
    Sid Ismail, Jun 17, 2006
    #2
    1. Advertising

  3. Ian Davies

    Jim Moe Guest

    Ian Davies wrote:
    > whats the syntax for a link to a bookmark on a page FROM A SEPARATE PAGE
    >

    <a href="http://example.com/separate-page.html#bookmark">

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
    Jim Moe, Jun 17, 2006
    #3
  4. Ian Davies

    dorayme Guest

    In article <>,
    Sid Ismail <> wrote:

    > On Sat, 17 Jun 2006 09:43:20 GMT, "Ian Davies" <>
    > wrote:
    >
    > : whats the syntax for a link to a bookmark on a page FROM A SEPARATE PAGE
    >
    >
    > "The NAME attribute defines a destination for a link. For example, a
    > document containing..."
    >
    > Quick - get here for the rest:
    > http://www.htmlhelp.com/reference/html40/special/a.html
    >
    > Sid


    Simplest is to use id:

    <H1 ID=foo>My heading</H1>

    instead of

    <H1><A NAME=foo>My Heading</A></H1>

    but some browsers (I forget which ones and how old) do not
    understand it. The idea to use both to cover such situations
    might seem silly to me (perhaps simpler to use name in that case)
    but there may be additional benefits for id to do with scripts?
    And to avoid - at least in a lot of modern browsers - unwanted
    anchor behaviour...

    --
    dorayme
    dorayme, Jun 17, 2006
    #4
  5. "dorayme" <> skrev i meddelandet
    news:...
    > In article <>,
    > Sid Ismail <> wrote:
    >
    > > On Sat, 17 Jun 2006 09:43:20 GMT, "Ian Davies" <>
    > > wrote:
    > >
    > > : whats the syntax for a link to a bookmark on a page FROM A SEPARATE

    PAGE
    > >
    > >
    > > "The NAME attribute defines a destination for a link. For example, a
    > > document containing..."
    > >
    > > Quick - get here for the rest:
    > > http://www.htmlhelp.com/reference/html40/special/a.html
    > >
    > > Sid

    >
    > Simplest is to use id:
    >
    > <H1 ID=foo>My heading</H1>
    >
    > instead of
    >
    > <H1><A NAME=foo>My Heading</A></H1>
    >
    > but some browsers (I forget which ones and how old) do not
    > understand it. The idea to use both to cover such situations
    > might seem silly to me (perhaps simpler to use name in that case)
    > but there may be additional benefits for id to do with scripts?
    > And to avoid - at least in a lot of modern browsers - unwanted
    > anchor behaviour...



    Which one is "strict"?

    --
    Luigi Donatello Asero
    https://www.scaiecat-spa-gigi.com/sv/faktaomitalien.php
    昨天晚上æ„大利队跟巴拉圭美国队赛了
    Luigi Donatello Asero, Jun 17, 2006
    #5
  6. Ian Davies

    dorayme Guest

    In article <4E%kg.5257$>,
    "Luigi Donatello Asero" <> wrote:

    > Which one is "strict"?


    Ask a precise question. Or I won't put in a sweet word for you
    with Heather...

    --
    dorayme
    dorayme, Jun 17, 2006
    #6
  7. "dorayme" <> skrev i meddelandet
    news:...
    > In article <4E%kg.5257$>,
    > "Luigi Donatello Asero" <> wrote:
    >
    > > Which one is "strict"?

    >
    > Ask a precise question. Or I won't put in a sweet word for you
    > with Heather...



    You wrote about the advantages/disadvantages
    of using one of the following alternatives
    <a name="..">description</a>
    or <a id="..">description</a>
    so I asked
    whether the former or the latter complies with the requirements to validate
    as HTML 4.01 strict.
    Or are they both accepted?

    --
    Luigi Donatello Asero
    https://www.scaiecat-spa-gigi.com/sv/faktaomitalien.php
    昨天晚上æ„大利队跟巴拉圭美国队赛了
    Luigi Donatello Asero, Jun 18, 2006
    #7
  8. Luigi Donatello Asero wrote:
    > "dorayme" <> skrev i meddelandet
    > news:...
    >> In article <4E%kg.5257$>,
    >> "Luigi Donatello Asero" <> wrote:
    >>
    >>> Which one is "strict"?

    >> Ask a precise question. Or I won't put in a sweet word for you
    >> with Heather...

    >
    >
    > You wrote about the advantages/disadvantages
    > of using one of the following alternatives
    > <a name="..">description</a>
    > or <a id="..">description</a>
    > so I asked
    > whether the former or the latter complies with the requirements to validate
    > as HTML 4.01 strict.
    > Or are they both accepted?
    >

    Both are acceptable, just that the latter maybe preferred because you
    don't have to add an 'A' element solely for providing an anchor, but can
    assign an anchor via the id of the referenced block.

    Instead of this:

    <!-- addition of extra element solely for creating anchors -->
    <a name="myAnchor"> </a><h2>Some section</h2>
    <p>....

    use this:

    <!-- Use the existing H2, not extra element needed -->
    <h2 id="myAnchor">Some section</h2>
    <p>....


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jun 18, 2006
    #8
  9. Ian Davies

    dorayme Guest

    In article <XS%kg.5259$>,
    "Luigi Donatello Asero" <> wrote:

    > "dorayme" <> skrev i meddelandet
    > news:...
    > > In article <4E%kg.5257$>,
    > > "Luigi Donatello Asero" <> wrote:
    > >
    > > > Which one is "strict"?

    > >
    > > Ask a precise question. Or I won't put in a sweet word for you
    > > with Heather...

    >
    >
    > You wrote about the advantages/disadvantages
    > of using one of the following alternatives
    > <a name="..">description</a>
    > or <a id="..">description</a>
    > so I asked
    > whether the former or the latter complies with the requirements to validate
    > as HTML 4.01 strict.
    > Or are they both accepted?


    Both. (I will now put in a good word for you with Heather who is
    a very close gossip friend of mine).

    --
    dorayme
    dorayme, Jun 18, 2006
    #9
  10. Ian Davies

    Toby Inkster Guest

    dorayme wrote:

    > <H1 ID=foo>My Heading</H1>
    > but some browsers (I forget which ones and how old) do not
    > understand it.


    The only *vaguely* significant one is, IIRC, Netscape 4.x.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jun 18, 2006
    #10
    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. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    626
    Iain Norman
    Feb 16, 2005
  2. JKop
    Replies:
    11
    Views:
    845
  3. Miles

    Quick Questions on Syntax

    Miles, May 26, 2008, in forum: Java
    Replies:
    10
    Views:
    489
    Arne Vajhøj
    May 27, 2008
  4. Robocop

    quick newbie syntax question

    Robocop, Oct 20, 2008, in forum: Python
    Replies:
    5
    Views:
    241
    Steven D'Aprano
    Oct 20, 2008
  5. Johannes Bauer

    Quick nested loop syntax?

    Johannes Bauer, Nov 19, 2008, in forum: Python
    Replies:
    3
    Views:
    335
    alex23
    Nov 20, 2008
Loading...

Share This Page