ie7奇怪的浮动权问题(ie7 weird float right problem)

编程入门 行业动态 更新时间:2024-10-24 18:25:19
ie7奇怪的浮动权问题(ie7 weird float right problem)

这是在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).

更多推荐

本文发布于:2023-07-26 17:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278899.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:奇怪   weird   problem   float

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!