A Web Design Community curated by Chris Coyier

Code Snippets Gallery

Code Snippets > CSS > Fixed Positioning in IE 6 Submit one!

Fixed Positioning in IE 6

* { margin:0; padding:0; }
html, body {
   height: 100%;
}
body #fixedElement {
   position:fixed !important;
   position: absolute; /*ie6 and above*/
   top: 0;
   right: 0;
}
#page-wrap {
    width: 600px;
    margin: 0 auto;
    font: 16px/2 Georgia, Serif;
}

The 100% height on the body and html stuff is in case you want to do fixed positioning along the bottom edge of the browser window.

Reference URL

7 Responses

  1. Hitesh Chavda says:

    Look like doe’t work on IE6

  2. FJ says:

    or you do it over expressions.. like this:

    * html #element{
    		position: absolute; left: 0px; top: 0px;
    		left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
    		top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
    }

    this is for position fixet on TOP

  3. Tony says:

    This tutorial saved my life. I didn’t think this was possible in IE6. Thank you, thank you, thank you.

  4. amtyera says:

    Sorry. Not working in IE6

  5. Shaz3e says:

    Not working for me too

Leave a Comment

Remember:
  • Be nice.
  • Wrap multiline code in <pre> and <code> tags and escape it first (turn <'s into &lt;'s).
  • You may use regular HTML stuff like <a href="">, <em>, and <strong>
* This website may or may not contain any actual CSS or Tricks.