IE8浮动问题与CSS [英] IE8 float issue with CSS

查看:114
本文介绍了IE8浮动问题与CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信这一定是必须的,因为我相信我不是第一个这样做,但我找不到答案。我使用重复的背景图片为< div> 创建阴影效果。在底部的两个角落,我使用小的9x5像素的图像。我左右漂浮他们和在Firefox和Safari他们看起来完美。在IE8(和可能的其他IE)中,它们左右浮动大约3px。

I'm sure this must have been covered before because I'm sure I'm not the first to do this, but I can't find the answer. I am creating a shadow effect for a <div> using repeated background images. In the bottom two corners I use small 9x5 px images. I float them left and right and in Firefox and Safari they look perfect. In IE8 (and possibly other IEs) they float too far to the left and right about about 3px.

您可以在这里是我的妻子的ebay模板。

You can see the issue at here. It's an ebay template for my wife.

到目前为止我已经尝试设置显示:内联这是一个类似的IE6问题的修复。我也尝试将图片边距和填充设置为0px,没有运气。

Thus far I've tried setting display:inline which was a fix for a similar IE6 issues. I also tried setting image margins and padding to 0px with no luck.

任何想法?

b $ b Carraig

Thanks, Carraig

推荐答案

在浏览网页时,我发现它默认为quirks模式,这是可能的问题,因为如果我强制它进入严格它似乎修复你的浮动问题在所有情况下的IE。

Whilst browsing your page I found that it is defaulting into quirks mode, which is the probable issue, because if I force it into Strict it seems to fix your floating problem in all cases of IE.

有一个阅读ppk的文章在这里:
http://www.quirksmode.org/css/quirksmode.html

have a read of ppk's article here: http://www.quirksmode.org/css/quirksmode.html

他解释了为什么它的发生和如何解决它:)

he explains why its happening and how to fix it :)

希望它帮助!

这篇关于IE8浮动问题与CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆