http://tagsoup.com/quirksmode/ >
position:fixed for Internet ExplorerThis is a hack to emulate the
CSS 2
positioning scheme
position:fixed
dynamic properties
behaviors
Status quo (2006-09-26): Internet Explorer 7 applies its numerous
CSS changes
The reason that the initial approach does not work in versions prior to 6 is lacking CSS support for the root element. There is, however, a trivial workaround: create a dummy element that serves as the document body and move the relevant properties one node down.
body
{
overflow: hidden;
}
div.content
{
height: 100%;
overflow: auto;
}Absolutely positioned elements outside of div.content will be fixed in respect to the viewport, absolutely positioned elements inside of div.content will behave normally. This works in version 5.0 and higher of IE on windows and is the most stable solution available.
This makes it mandatory to trigger quirks mode for IE >= 6, e.g. by inserting a comment (accurately:
comment declaration
other prolog
No user agent but Windows Internet Explorer must be exposed to any of the CSS rules relevant to the hack; I strongly recommend using
conditional comments
exploiting
Some older user agents that support position:fixed cannot handle it very well,
e.g. IE 5/Mac
@import
@media screen
<style type='text/css'>@import 'all.css';</style>
<!--[if IE]>
<link
href='ie_win.css'
type='text/css'
media='screen'>
<![endif]-->Using @import in a style element to basically link a style sheet is somewhat ugly but compact; blindly spawning http connections with multiple linked, imported and conditional style sheets is not a good idea, especially since user agents commonly request all files associated with a document, regardless of whether or not they actually support the corresponding MIME or media types.
Internet Explorer >= 6 supports CSS for the root element in ‘standards-body element to be fixed in respect to the viewport.
@media screen
{
* html
{
overflow-y: hidden;
}
* html body
{
height: 100%;
overflow: auto;
}
}There are a couple of disadvantages involved:
position:absoluteoverflow-yoverflowOn the upside,
On 2002-02-05 someone dumped a query regarding fixed document content in the Dutch news group
nl.internet.www.ontwerp
javascript
the local
wizard
bulletproof
hairy
CSS-only mock-up
link rot
a mirror
Rijk van Geijtenbeek
A short time later, this became quite popular in the course of an mxvision feature. Since the interest flux did not drop, I added some improvements in terms of stability, and finally support for IE 5 – but not before having witnessed that
the enemy does not sleep either
answer on a request for clues
hack attack
Thanks for contributions, head-ups and inspiration to ‘Warden Dave’,
Tim Rivera
Barbara de Zoete

