views:

1591

answers:

2

Hey,

I have a sidebar on my webpage that is supposed to span 100% of the page (vertically). It is then supposed to stay there, so when the rest of the content scrolls it does not. To do 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 would do this?

+1  A: 
Triptych
every time you use a frame God slaughters an <abbr>
Jimmy
They are an abomination. I agree. Then again, sometimes clients just want what they want; it's not always in the developer's hands.
Triptych
+1  A: 

As stated here

  1. First, put IE6 into "standards mode" by using a strict DOCTYPE. Note that IE6's standards mode is known for its extremely odd quirks. We are taking advantage of one now.
  2. Use IE conditional comments to style the HTML and BODY tags like so:

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

  3. Style anything you want to stay fixed as position:absolute.

bchhun