Re: Document fragment anchor elements

Dave J Woolley wrote:
> 
> > From: glen@superexpert.com [SMTP:glen@superexpert.com]
> >
> > I'm confused regarding the reason why the A element that specifies an
> > anchor to a document fragment requires an ending tag.  What is the 
> > purpose of the end tag of an A element when it names an anchor to a 
> > document fragment?
> [DJW:]
> It's a consequence of using A for two purposes.  The closing
> tag cannot be conditional on the attributes.  The reason is
> possibly lost in time, as I don't know of anything that targets
> as having contents.

I always place my anchor tags around some significant bit of the
text I'm linking to. For instance, when I link to a heading, I
put the anchor tags around the heading text. The HTML 4.0 spec 
does this, too--take a look at the source. Point being, you're
linking to some information, not an empty string. This is why
HTML is moving away from <a> tags as link targets and using the 
id attribute of other elements instead--you link to a particular 
element and its contents.

Received on Thursday, 10 May 2001 21:23:41 UTC