Divs从页面边缘掉下来了吗? [英] Divs fall off edge of the page?

查看:52
本文介绍了Divs从页面边缘掉下来了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是有问题的页面。

http://www.rockymountainpond.com/metal/examples.php



现在出于某种原因,我在代码中弄乱了一些东西,我再也无法在IE中工作了......

这里是CSS


有什么想法吗?我已经和它搏斗了几个小时,我的转变即将结束,所以早上的任何帮助都会受到赞赏。 Firefox和Opera似乎并不喜欢高度100%的想法做出它所支持的事情。 = P

Okay, here''s the page in question.

http://www.rockymountainpond.com/metal/examples.php

I had it working fine in IE, in which the main background would extend all the way to the bottom even with the pictures in there, though it never worked right with FF or Opera.

Now for some reason I messed something up in the code and I can''t get it to work in IE anymore...

Here''s the CSS

Any ideas? I have wrestled with it for a couple hours now and my shift is about to end, so any help by morning would be appreciated. Firefox and Opera just don''t seem to like the idea of height 100% doing what it''s SUPPOSED to do. =P

推荐答案

IE正在做你想要的但是IE没有像往常一样正常运行。这是IE中的一个错误,让许多开发人员感到沮丧。父div不是为了包含浮动内容而扩展,但IE无论如何都会这样做。 Firefox和Opera以及其他所有浏览器都能做到这一点。


为了让现代浏览器(即非IE)能够做你想做的事,添加overflow:auto;你的#frame div。


此外,IE与高度相悖,而不是其他浏览器。在IE中使用高度引起的问题比其他任何问题都要多。
IE is doing what you want but IE is not performing correctly, as usual. This is a bug in IE and frustrates many developers. Parent divs are NOT to expand to enclose floated content but IE does it anyway. Firefox and Opera and every other browser does get this right.

To get modern browsers, ie not IE, to do what you want, add overflow:auto; to your #frame div.

In addition, IE struggles with height, not the other browsers. More problems are caused by the use of height in IE than any other.


那就是我想要它做的事情,但现在围绕着#frame有一个难看的滚动条div。
Well that did what I wanted it to do, but now there''s an unsightly scrollbar enclosing around the #frame div.


因为您将帧的高度指定为100%。删除它。
Because you specified the height of the frame as 100%. Remove that.


这篇关于Divs从页面边缘掉下来了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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