...

View Full Version : Anchor Tag Problem In IE



doublek321
12-07-2005, 05:21 PM
I have a problem that's happening in IE (version 6 for sure but maybe more than that) but not in firefox. I have an anchor tag with an href URL. Inside that element I have a bunch of subelements (divs, tables, images, etc). The functionality I want is for the user to be able to click ANYWHERE and be sent to the URL I specified in the anchor tag. In firefox, this works perfectly. In IE, however, left-clicking doesn't work. If you right-click and "open in new window", however, it works fine. I'm guessing that IE doesn't like that I have all these subelements within my anchor tag. If anyone has a solution for me I'd greatly appreciate it. If it helps any, the subelements are...

<a href="SOME_URL">
<div>
<div>
<img></img>
</div>
<div>
</div>
<table>
<tr>
<td>
</td>
<td>
<img></img>
</td>
</tr>
</table>
</div>
</a>

mark87
12-07-2005, 05:24 PM
According to the w3 (http://www.w3.org/TR/html4/struct/links.html#edef-A), an anchor can contain any inline element but not another anchor (so no block elements such as the DIV's).

narayana
10-11-2007, 07:34 AM
Hi,

I am having the same problem with IE, and working fine in firefox. Please help me out to solve this issue.

my code is like this:

<a .....>
<div...>
<img ..../>
</div>
</a>

Thanks in advance.

--
narayana

_peter_
10-11-2007, 08:07 AM
do not use a around so many elements.

put a div and put onclick="window.location='new.html'"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum