这是在IE7中给我带来问题的html代码
<div style="position:absolute;top:276px;left:194px;" class="drag layer_3"> <img class="deleteitem" height="12px" width="12px" title="Remove" src="/static/redclose.png" style="float:right;cursor:pointer;"> <img src="/static/18.png" > </div>这是它应该看起来的样子,它在ie8,firefox中看起来很好
http://img200.imageshack.us/img200/189/ie8.png
但是在IE7中,浮动右图像会像这样跳到文档的右端
http://img33.imageshack.us/img33/6239/ie7bug.png
我该如何解决? 我尝试删除高度宽度属性并使用max-height,max-width。 这没有帮助。 非常感谢
here is the html code that is giving me problem in IE7
<div style="position:absolute;top:276px;left:194px;" class="drag layer_3"> <img class="deleteitem" height="12px" width="12px" title="Remove" src="/static/redclose.png" style="float:right;cursor:pointer;"> <img src="/static/18.png" > </div>this is how it is supposed to look, and it looks fine in ie8, firefox
http://img200.imageshack.us/img200/189/ie8.png
but in IE7, the float right image jumps to the right end of the document like this
http://img33.imageshack.us/img33/6239/ie7bug.png
how do i fix this? i tried removing the height width attributes and use max-height,max-width. that did not help. thanks a lot
最满意答案
您的问题可能已在此处得到解答: 浮动太远了!
他建议使用jQuery来执行此操作,因为它被编写为独立于浏览器。
另外,请在底部查看原作者的解决方案(不使用jQuery)。
Your question might have been answered here: Floating Too Far Right!
He suggests using jQuery to do this, since it is written to be browser-independent.
Also, see the original author's solution at the bottom (not using jQuery).
更多推荐
发布评论