在Chrome中固定的位置 [英] Position Fixed in Chrome

查看:95
本文介绍了在Chrome中固定的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有一个小问题,我有一个酒吧,上面有一个漂浮在酒吧上方的盒子,在IE,Firefox,Opera上一切正常,但是在Chrome和Safari中,盒子必须在酒吧上方漂浮在吧台一侧,不高于它.

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 是容器,菜单是容器上方的框

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

有人可以帮我吗?

预先感谢

推荐答案

以防万一有人获得相同的Chrome行为.

Just in case someone is getting the same chrome behaviour.

chrome似乎认为页面加载后(例如,使用jQuery.load())添加到DOM的元素的视口仅限于该元素的div.

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.

我想.asp是在文档加载后注入barraDerecha的,因此它相对于其容器定位.

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

这篇关于在Chrome中固定的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆