Log in

View Full Version : Can I put a named anchor tag at an image location?


NeedKarma
Oct 11, 2006, 11:41 AM
Something like this:


<A name="NKmessage"><IMG alt="" src="/xxxx/Gord.jpg"> </A>
Or do you absolutely have to have text in the anchor tag?

Roel Zylstra
Oct 11, 2006, 12:25 PM
Sure you can use "name" in an anchor tag without anchor text, but if you don't use href then some older browsers may not react to a # href within another link.

NeedKarma
Oct 11, 2006, 03:25 PM
I tried it using IE and when I try the url that has the "#NKmessage" at the end I simply end up at the top of the page.

LTheobald
Oct 16, 2006, 09:50 AM
The two lines of :


<a name="img"><img src="something.jpg" alt="something"></a>


And then



<a href="#img">Back to image</a>


Worked for me in IE 7, Firefox and whatever the internal browser in HTML Kit is based on.

NeedKarma
Oct 16, 2006, 09:56 AM
I'll try that. Thanks.

NeedKarma
Oct 16, 2006, 11:08 AM
Works like a charm. Thanks Guys!