Results 1 to 2 of 2

Thread: Position not really working in IE

  1. #1
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Position not really working in IE

    Hello all.

    I was trying a CSS code I saw here, so I can make a floating menu. The CSS looks very simple and clean and it works perfectly on Firefox and Opera.

    Code:
    div.cssFloatMenu {
      margin: 0;
      position:fixed;
      bottom: 10px;
      right: auto;
      width: 150px;
      left: 11%;
    }
    The problem is "position:fixed;" doesn't work in IE. The site says that it can work in IE with a "work-around".

    The mentioned "work-around" is the following code:

    Code:
    <!--[if gte IE 5.5]><![if lt IE 7]>
    <style type="text/css">
    div.cssFloatMenu {
        margin: 0;
        position: absolute;
        top: expression(18+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px');
        bottom: auto;
        left: auto;
        width: 170px;
        right: 20px;
    }
    </style>
    <![endif]><![endif]-->
    But the problem is that I wanted the div menu to be "fixed" on the bottom of the page, not on the top. I can't figure out how to do that. Can anyone help me?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If that works for the top, this should work for the bottom:

    Code:
    <!--[if gte IE 5.5]><![if lt IE 7]>
    <style type="text/css">
    div.cssFloatMenu {
        margin: 0;
        position: absolute;
        top: expression(-18+((e=document.documentElement.scrollTop)?e+document.documentElement.clientHeight:document.body.scrollTop+document.body.clientHeight)+'px');
        bottom: auto;
        left: auto;
        width: 170px;
        right: 20px;
    }
    </style>
    <![endif]><![endif]-->
    The -18 may be adjusted to get the desired offset from the bottom.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •