Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    when I resize my window, My fixed content menu moves

    I have used the method specidied on this site to create a fixed content using CSS. when I scroll up and down the menu is fixed. however when I resize my window from the right or the left, my fixed content menu moves and ends up floating on my table blocking the table contents. I noticed that the fixed content menu on the tutorial page on this site does not move when I resized the window. what is the trick?
    I even included the code for IE but no use. I am using Mozilla firefox 2.0.0.7
    can you please help me? I have pasted the code I am using.

    <style type="text/css">

    /*#mydiv{
    position: fixed;
    left: 240px;
    top: 340px;
    }*/
    #mydiv{ /*IE6 only rule, applied on top of the default above*/
    position: absolute;
    top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+50+"px" : body.scrollTop+50+"px");
    left: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollLeft+10+"px" : body.scrollLeft+10+"px");
    }

    <div id="mydiv">
    my table goes here
    </div>
    </style>

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    Do you have a width set on anything?
    Or are you clearing the div's?

    Those are two things I'd be checking for if I was to see the entire code. (hint)

  • #3
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Sometimes better to size things in percentages instead of pixels etc.

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.


  •  

    Posting Permissions

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