[thelist] anchors in IE

James Aylard jaylard at encompass.net
Fri Mar 9 16:54:53 CST 2001


Ben Henick wrote:

> I find it entirely likely that IE's choking on the lack of a closing
> tag.

	Yes, a closing tag is *always* required for an anchor. Leaving it off would
likely cause problems. In theory, the opening and closing tags don't need
any content between them, but some browsers don't like them if they don't.
So it's best to wrap them around something.

> It's true that HREF and NAME are mutually-exclusive attributes for
> the anchor tag, but the use of NAME doesn't remove the requirement to use
> a closing tag.

	Actually, that's not so. An anchor can be both a hyperlink (containing an
href attribute) and a link target (containing a name attribute -- or an id
attribute for UAs that support the HTML 4.x recommendation). For an example
of an anchor element that contains both attributes, see:

http://www.w3.org/TR/html401/struct/links.html#h-12.2

	Also, developers have reported long-standing problems with IE reliably
locating named anchors on a page. This was the topic of a brief thread on
another list:

http://microsoft.ease.lsoft.com/scripts/wa-msn.exe?A2=ind0011B&L=IE-HTML&P=R
3232&m=38035

James Aylard





More information about the thelist mailing list