|
-
Sep 30th, 2004, 11:46 AM
#1
Thread Starter
Junior Member
CSS Scrolling bug
http://www.filterone.net
The problem only seems to appear in Firefox, try resizing the browser so that not all of the content appears on the screen and a scroll bar appears. Use the scrollbar and you'll see that the background doesn't stretch to fit anymore.
Any ideas would be much appreciated.
Last edited by Merrissey; Sep 30th, 2004 at 11:59 AM.
-
Sep 30th, 2004, 12:58 PM
#2
Frenzied Member
I'm sure someone like CB will have much more to say about this, all I can say is that neither the HTML nor the CSS validate. So don't blame the browser quite yet.
Have I helped you? Please Rate my posts. 
-
Sep 30th, 2004, 04:57 PM
#3
Don't blame the browser at all. This is a case of IE behaving incorrectly in a way that trips most authors.
Specifically, if height is specified, then the height of the element is exactly the specified value, no more, no less. You specify the height of the content div as 100% of the containing box, which is frame, which has as height 100% of the containing box, which is body, which has as height 100% of the containing box, which is the viewport!
In other words, the content div is exactly as high as the viewport. No more, no less. Thus, if the viewport is shorter than the space the content requires and you scroll down, you realize that the content div doesn't go there. The actual content - the ps - overflows according to the overflow rule. It is still visible.
IE behaves incorrectly in that boxes expand to hold their content even if the height is explicitely specified. It thus behaves as if the height property was a minimum height, not a definite height.
What you want, therefore, is to specify a minimum height. You do that with the min-height property. IE doesn't support it, so you have to work around that.
The usual solution goes along the lines of:
Code:
#thediv { min-height: 100%; }
some_IE_hack #thediv { height: 100%; }
Here are some suggestions:
This works because IE incorrectly believes that there is some mystery tag around the html - or perhaps it allows * to match nothing. Either way, this selector applies to nothing in all browsers but IE.
Code:
#thediv { _height: 100%; }
IE's CSS parser is so incredibly forgiving that it doesn't mind some random characters in front of the property name. This doesn't validate.
Code:
#thediv { height: 100%; h\eight: auto; }
This goes the other way. It specifies height as 100% for all browsers, and then goes on and resets it to auto in browsers with a proper parser, which correctly ignores the backslash. The backslash might have to be at the start of the word, I'm not sure.
Code:
<!--[if IE] !><link rel="stylesheet" href="ie_specific.css"><! [endif]-->
The IE conditional comments are very useful for presenting any HTML only to IE. ie_specific.css would then contain the IE-specific rules.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 1st, 2004, 11:22 AM
#4
Thread Starter
Junior Member
Thanks for taking the time to reply. It sort of fixes the issue in the sense that nothing changes when you scroll down, the problem now is that it only stretches to fit the content, rather than to fit the entire height of the page. Know if there's any solution?
-
Oct 1st, 2004, 12:05 PM
#5
Uh... I think that's a bug then... must have something to do with all the floats.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|