奇怪的 Internet Explorer 和 Firefox CSS 问题
我的一个朋友向我寻求帮助,但我无法发现错误。 这是关于:
http://www.nachhilfe-hh.de/nachhilfe-hamburg-west.php
问题是手机图像被剪切并且文本与 Internet Explorer 重叠。火狐浏览器运行良好。我用Firebug分析了CSS,发现少了一个“”。这解决了一个问题,但没有解决图像问题。 如果我尝试更改图像的宽度:不会发生。 如果我尝试更改文本的位置: IE 或 Firefox 中的外观要么很糟糕。 并更改“
有人有主意吗?请问?
A friend of mine ask me for help, but I'am not able to spot the mistake.
It's about:
http://www.nachhilfe-hh.de/nachhilfe-hamburg-west.php
The problem is that the phone image is getting cutted and the text is overlapping with Internet Explorer. Firefox works fine. I analysed the CSS with Firebug and found out that there was a missing "< /div >". That solved a problem, but not the ones with the image.
If I try to change width of the image: Not happens.
If I try to change position of the text: Either the appearance sucks in IE or Firefox.
And changing "< div >" to "< span >" is also causing no effect.
Does someone have an idea? Pls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.telefoncontainer
的宽度为width:329px
,图片的宽度为 370px。它适用于其他浏览器,因为
.telefoncontainer p
的宽度很好。但是 IE 会忽略子级的宽度来调整父级的宽度。.telefoncontainer
got awidth:329px
and the picture got one of 370px.It works on other browser because
.telefoncontainer p
's width is good. But IE ignore children's width to resize the parent's one.首先:仍然缺少
:http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.nachhilfe- hh.de%2Fnachhilfe-hamburg-west.php
我建议避免使用
position:relative
。这是重叠的原因,即使您在这种情况下发现错误,它也可能导致其他地方出现更多重叠。将 telefoncontainer 的 HTML 简化为:(
所有额外的
p
、div
和center
都是不必要的)。然后调整容器的内边距,直到内容正确定位。
示例: http://jsfiddle.net/sVhd2/
First off: There is still a
</div>
missing: http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.nachhilfe-hh.de%2Fnachhilfe-hamburg-west.phpI'd suggest to avoid
position: relative
. It the reason for the overlapping, and even if you find the error in this case, it can lead to more overlapping in other places.Simplify the HTML for the telefoncontainer to:
(All the extra,
p
s,div
s andcenter
are unnecessary).And then just adjust the
padding
of the container, until the content are positioned correctly.Example: http://jsfiddle.net/sVhd2/
您是否尝试过使用条件注释专门针对 IE?这将允许您为每个浏览器使用不同的样式,因此一个浏览器的更改不会破坏另一个浏览器。请参阅:http://www.quirksmode.org/css/condcom.html很好地贯穿了这些功能和用法
have you tried using a conditional comment to target IE specifically? this will allow you to have different styles for each browser, so a change in one shouldn't break the other. See: http://www.quirksmode.org/css/condcom.html for a good run-through of the capabilities and usage of these