quick syntax question

I

Ian Davies

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

thanks
ian
 
D

dorayme

Sid Ismail said:
: 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...
 
L

Luigi Donatello Asero

dorayme said:
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"?
 
L

Luigi Donatello Asero

dorayme said:
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?
 
J

Jonathan N. Little

Luigi said:
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>....
 
D

dorayme

Luigi Donatello Asero said:
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).
 
T

Toby Inkster

dorayme said:
<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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top