Position Fixed in Chrome

11,507

Just in case someone is getting the same chrome behaviour.

It looks like chrome considers that the viewport of an element added to the DOM after the page is loaded (for instance, using jQuery.load()) is restricted to the containing div of this element.

I guess .asp is injecting your barraDerecha after document load, so it positions relative to its container.

Share:
11,507

Related videos on Youtube

Admin
Author by

Admin

Updated on April 16, 2022

Comments

  • Admin
    Admin about 2 years

    I have a little problem with my site, I have a bar and on it a box that float above the bar, everything works fine in IE, Firefox, Opera, but in Chrome and Safari the box that must be above the bar float by the bar side no above it.

     #barraDerecha 
     {
         width:240px;
         background-color:#e5e5e5;
         border-left:solid 2px #CCC;
         border-bottom:solid 2px #CCC;
         position:absolute; 
         margin-top:-10px;
         margin-left:717px;
         height:auto;
     }
    
     #barraDerecha #menu
     {
        display:block; 
        position:fixed;
        width:220px;
     }
    

    barraDerecha is the container and menu is the box that goes above the container

    Can somebody help me please?

    Thanks in advance

  • Residuum
    Residuum almost 15 years
    According to standard, position fixed is always relative to the viewport, not to any parent.