Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Anchor Tag Problem In IE

    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>

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    According to the w3, an anchor can contain any inline element but not another anchor (so no block elements such as the DIV's).

  • #3
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Oct 2007
    Posts
    22
    Thanks
    0
    Thanked 4 Times in 4 Posts
    do not use a around so many elements.

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •