< a& gt;内的图片和文字标签

问题描述:

这是生成的html asp.net(已删除一些标识客户端的详细信息)

This is the html asp.net generated (with some client-identifying details removed)

在Windows XP/IE 7中,单击图像不会执行任何操作.单击文本将执行超链接.右键单击任意位置,然后选择在新窗口中打开 open 也是可行的.

In Windows XP / IE 7 clicking on the image does nothing. Click on the text executes the hyperlink. Right-clicking anywhere and then selecting open in new window or open also works.

在其他浏览器中,它们都能按预期工作.

In other browsers, it all works as expected.

有没有简单的人可以看到我可以做到的事情,以使其在IE7中正常工作?

Is there anything simple anyone can see that I could do to this to get it to work correctly in IE7?

<div id="hdrXXX">                      
            <a id="ctl00_XXX" title="XXX" class="hdrXXX" href="http://google.com" target="_blank">
                 <div style="float:left;display: block;"> 
                    <img id="ctl00_XXX" src="Images/XXX.png" style="border-width:0px;" />
                </div>
                <div style="float:left; display: block; padding:15px 0 0 0;"> 
                    <span id="XXX">Some text right here</span>

                </div>
            </a>  
       </div>  

您只能将块级元素放在具有HTML5的锚点元素内,而浏览器支持仍然有些悬念.IE7显然不支持此功能.

You can only put block-level elements inside anchor elements with HTML5 and browser support is still a bit iffy on it. IE7 obviously does not support this.

您无需使用除法即可做到这一点:

You don't need to use division to do this:

<div id="hdrXXX">                      
    <a id="ctl00_XXX" title="XXX" class="hdrXXX" href="http://google.com" target="_blank">
        <img id="ctl00_XXX" src="Images/XXX.png" style="border: 0; float: left; margin-right: 15px" /> 
        <span id="XXX">Some text right here</span>
    </a>  
</div>

这应该可以达到相同的效果...

This should work to the same effect...