简体   繁体   English

IE中的间距混乱(html / css问题)

[英]Spacing is messed up in IE (html/css issue)

sorry about this, I'm normally fine with HTML/CSS, but I'm stuck on this. 对此感到抱歉,我通常对HTML / CSS没问题,但是我对此感到困惑。

Basically, I have a header, with navigation below that, and then a small space, followed by an area for the content of the site. 基本上,我有一个标头,其下是导航,然后是一个小空间,后跟一个用于网站内容的区域。 It's working perfectly in Firefox, but annoyingly, in IE, that small space becomes pretty large. 它在Firefox中可以完美地工作,但是在IE中令人讨厌的是,很小的空间变得很大。 Lowering the value for margin-top on the indexbody class fixes the problem for IE, but removes any kind of gap at all for Firefox. 降低indexbody类上的margin-top值可以解决IE的问题,但可以消除Firefox的所有空白。

My code is here. 我的代码在这里。 I can provide more of it if needed :) 如果需要,我可以提供更多信息:)

Thanks loads in advance! 提前感谢负载! :) :)

*code edited out: see http://jsfiddle.net/eoJ1/PRjF7/ or http://www.joemarketeer.com/stackoverflow/index.html :) *已删除的代码:请参见http://jsfiddle.net/eoJ1/PRjF7/http://www.joemarketeer.com/stackoverflow/index.html :)

Thanks again! 再次感谢! Sorry for the wall of text. 很抱歉,无法显示文字。

It's because IE is registering the height on your "navigation" div and also you are using a margin-top: 90px to add the spacing. 这是因为IE在“导航” div上注册了高度,并且您还使用了margin-top:90px来添加间距。 whereas other browsers are disregarding the "navigation" height and basically just using the margin-top:90px you have on your content area. 而其他浏览器则忽略了“导航”高度,基本上只使用了内容区域中的margin-top:90px。

Use a clearfix on that navigation div that has the floats and then use "margin-bottom: 30px" on the navigation instead of "margin-top:" on the content area. 在具有浮点数的导航div上使用clearfix,然后在导航区域上使用“ margin-bottom:30px”,而不在内容区域上使用“ margin-top:”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM