Mock position: fixed in IE6 with div 100% height?

I have a sidebar on my web page that needs to cover 100% of the page (vertically). It then has to stay there, so when the rest of the content scrolls, it doesn't. For this I used:

body
{
    height: 100%;
}

#sidebar
{
    height: 100%;
    width: 120px;
    position: fixed;
    top: 0;
    left: 0;
}

      

This works great in all modern browsers! Unfortunately I have to code for IE6 which does not support position: fixed. Do you have any idea how I'm going to do this?

0


source to share


2 answers


This fix ''



Me? I would go straight to the more common navigation method or use (gasp) frames.

+1


source


As stated here



  • First, set IE6 to "standards mode" using a strict DOCTYPE. Note that IE6 standards mode is known for its extremely unusual quirks. Now we are using one of them.
  • Use IE conditional comments for HTML styles and BODY tags like this:

    html, body {height: 100%; overflow: auto;}

  • The style you want to keep fixed as position: absolute.

+1


source







All Articles