HighDots Forums  

<a name=foo> close?

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss <a name=foo> close? in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mason A. Clark
 
Posts: n/a

Default <a name=foo> close? - 07-07-2005 , 03:07 AM






This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?
Must it have content?

W3C says the content cannot be block so what if :

<a name="foo">
<h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

<a name="foo">&nbsp;</a> is ok but uses a line
<h2>Foo Is Good</h2>

Mason C

Reply With Quote
  #2  
Old   
Mark Parnell
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 03:17 AM






Previously in comp.infosystems.www.authoring.html, "Mason A. Clark"
<masoncERASETHIS (AT) ix (DOT) netcom.com> said:

Quote:
Must <a name="foo"> be closed with </a> ?
Yes, according to the DTD.

Quote:
Must it have content?
Yes, as above.

Quote:
a name="foo"
h2>Foo Is Good</h2> ( a likely location )
How about:

<h2 id="foo">Foo Is Good</h2>

--
Mark Parnell
http://www.clarkecomputers.com.au


Reply With Quote
  #3  
Old   
Roland
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 03:25 AM



On 7-7-2005 9:07, Mason A. Clark wrote:
Quote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?
For HTML 4.01: Yes, "Start tag: required, End tag: required", see
<http://www.w3.org/TR/html401/struct/links.html#edef-A>
Quote:
Must it have content?
No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."
Quote:
W3C says the content cannot be block so what if :

a name="foo"
/a
h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

a name="foo">&nbsp;</a> is ok but uses a line
h2>Foo Is Good</h2

How about
<h2><a name="foo">Foo Is Good</a></h2>
Quote:
Mason C
--
Regards,

Roland de Ruiter
` ___ ___
`/__/ w_/ /__/
/ \ /_/ / \


Reply With Quote
  #4  
Old   
Mark Parnell
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 03:26 AM



Previously in comp.infosystems.www.authoring.html, Mark Parnell
<webmaster (AT) clarkecomputers (DOT) com.au> said:
Quote:
Previously in comp.infosystems.www.authoring.html, "Mason A. Clark"
masoncERASETHIS (AT) ix (DOT) netcom.com> said:

Must it have content?

Yes, as above.
My bad. No, it doesn't have to have content.

--
Mark Parnell
http://www.clarkecomputers.com.au


Reply With Quote
  #5  
Old   
Mason A. Clark
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 04:53 AM



On Thu, 07 Jul 2005 09:25:03 +0200, Roland <roland (AT) phony (DOT) biz> wrote:

Quote:
On 7-7-2005 9:07, Mason A. Clark wrote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?
For HTML 4.01: Yes, "Start tag: required, End tag: required", see
http://www.w3.org/TR/html401/struct/links.html#edef-A
Must it have content?
No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."
That's exactly what got me into this: - failure to find empty <a...></a>

<H2 id="fooname" .. has been suggested.

But the W3C site says:

"However, browser support for ID link destinations is very poor, so A NAME will
be needed for quite awhile. "

At the moment I'm stuck with <a name="foo">&nbsp;</a> and a line
used for the space.

Mason C

Quote:
W3C says the content cannot be block so what if :

a name="foo"
/a
h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

a name="foo">&nbsp;</a> is ok but uses a line
h2>Foo Is Good</h2

How about
h2><a name="foo">Foo Is Good</a></h2
Mason C


Reply With Quote
  #6  
Old   
Mason A. Clark
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 04:53 AM



On Thu, 7 Jul 2005 17:17:47 +1000, Mark Parnell
<webmaster (AT) clarkecomputers (DOT) com.au> wrote:

Quote:
Previously in comp.infosystems.www.authoring.html, "Mason A. Clark"
masoncERASETHIS (AT) ix (DOT) netcom.com> said:

Must <a name="foo"> be closed with </a> ?

Yes, according to the DTD.

Must it have content?

Yes, as above.

a name="foo"
h2>Foo Is Good</h2> ( a likely location )

How about:

h2 id="foo">Foo Is Good</h2
see my comment in another post: W3C warns against this



Reply With Quote
  #7  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 05:14 AM



On Thu, 7 Jul 2005, Mason A. Clark wrote:

Quote:
This seems too simple by I can't find the answer.
Use a formal validator to verify the answers to most of your
questions.

Quote:
Must <a name="foo"> be closed with </a> ?
yes.

Quote:
Must it have content?
In theory "not necessarily", but some older browsers do require it or
they don't work. Whether you can be bothered to be compatible with
such older browsers is probably your choice now - some authors feel
that using the id= attribute on the appropriate element (in your case
the "h2") is now adequate and the use of "a name=" is a superfluous
compatibility feature, we can't tell you what your decision should be
on that, but let's assume that you still want to...

Quote:
W3C says the content cannot be block
right, and so will a formal validator

Quote:
so what if :

a name="foo"
h2>Foo Is Good</h2> ( a likely location )
Put <a name="foo" id="foo">...</a> inside the block element if you
want to cover all bases. One possibility would be:

<h2><a name="foo" id="foo">Foo Is Good</a></h2>

Quote:
a name="foo">&nbsp;</a> is ok but uses a line
No need to invent fake content!

Watch your CSS styles - if you've specified a style for /all/ "a"
elements, then it's going to get applied to this "a" element too,
which might not be what you want. Use a:link etc. to make the styles
more selective.

hope this helps.


Reply With Quote
  #8  
Old   
Els
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 05:16 AM



Mason A. Clark wrote:

Quote:
On Thu, 07 Jul 2005 09:25:03 +0200, Roland <roland (AT) phony (DOT) biz> wrote:

On 7-7-2005 9:07, Mason A. Clark wrote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?
For HTML 4.01: Yes, "Start tag: required, End tag: required", see
http://www.w3.org/TR/html401/struct/links.html#edef-A
Must it have content?
No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."

That's exactly what got me into this: - failure to find empty <a...></a

H2 id="fooname" .. has been suggested.

But the W3C site says:

"However, browser support for ID link destinations is very poor, so A NAME will
be needed for quite awhile. "

At the moment I'm stuck with <a name="foo">&nbsp;</a> and a line
used for the space.
Can't say I've found a user agent yet that fails to find <a id="foo"
name="foo"></a>. Anyone know which one would fail that?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Squeeze - Can of Worms


Reply With Quote
  #9  
Old   
David Dorward
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 06:32 AM



Mason A. Clark wrote:

Quote:
"However, browser support for ID link destinations is very poor, so A NAME
will be needed for quite awhile. "
When was that document written? The last browser I know which didn't support
id in that way was Netscape 4.x.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #10  
Old   
Thomas Dowling
 
Posts: n/a

Default Re: <a name=foo> close? - 07-07-2005 , 08:10 AM



Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote in
news:84v54bry5vkh.1nnl8wb24btdb.dlg (AT) 40tude (DOT) net:

Quote:
Mason A. Clark wrote:
H2 id="fooname" .. has been suggested.

But the W3C site says:

"However, browser support for ID link destinations is very poor,
so A NAME will be needed for quite awhile. "


Can't say I've found a user agent yet that fails to find <a
id="foo" name="foo"></a>. Anyone know which one would fail that?
IIRC, Netscape 4. I didn't find the quoted page at W3C, but a similar
page at <http://www.htmlhelp.com/reference/html40/special/a.html> is
dated from 1998, when NS4's various incompetencies would have merited a
warning like this.

--
Thomas Dowling
Ohio Library and Information Network


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.