Forum Moderators: not2easy
#centerbody {
position : relative;
width : 972px;
margin-left : auto;
margin-right : auto;
border-bottom : 10px solid #fffffe;
border-left : 10px solid #fffffe;
border-right : 10px solid #fffffe;
background:#fff;
}
html{
overflow:scroll;
overflow-y:scroll;
overflow-x:auto;
}
overflow-y:scrollshould be applied to the
htmlelement (not the
body) in order to work in IE6 and IE7.
overflow-y:scrollto the
bodyshould have at least worked in all other browsers?! Which browser were you testing?
Of course if IE5 and under was your concern as you mentioned css1 then Ie5 doesn't know what the html element is anyway
I viewed it in Firefox 6.0.2.
overflow-y:scroll did not give a vertical scroll bar.
However overflow:scroll applied to the Body gives a normal size vertical scroll bar and, it validates (CSS level 2.1). So I am satisfied.
Tks
Hm, you could probably have left off the last half-dozen or so words there
It shows OK in IE7 but not in IE6. Tested with Adobe Browser Lab.
Come to think of it... IE6 and IE7 always have a vertical scroll bar present on the browser window (greyed out when not required)!? And this certainly seems to be the case in IE8 under "IE7 Browser Mode" and in IETester (IE6 and IE7). This probably explains why trying to set overflow-y:scroll on the body produces an additional scroll bar in these browsers!
UAs must apply the 'overflow' property set on the root element to the viewport. When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport, if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'. The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
From my experience, Adobe Browser Lab captures the client area only
The problem actually seems to be that IE6 and 7 apply overflow-y:scroll by default to the html elementBy default overflow-x:auto and overflow-y:scroll. It's gone by ie8+
The specs basically say that overflow applied to the body element should be propagated to the viewport.Also note that only applies if overflow is set to visible. For ie<8, as overflow was explicitly set to auto/scroll it wouldn't apply.
The behavior of the 'auto' value is user agent-dependent, but should cause a scrolling mechanism to be provided for overflowing boxesand the recs go on to say
Even if 'overflow' is set to 'visible', content may be clipped to a UA's document window by the native operating environment. {My bold}- which seems to explain early ff behaviour ... although choosing not to produce a scrolling mechanism because the recs say "should" rather than "must" seems unhelpfully pedantic to the extreme!
Also note that only applies if overflow is set to visible. For ie<8, as overflow was explicitly set to auto/scroll it wouldn't apply.