位置:修正了在Google Chrome中无法使用的情况 [英] position:fixed not working in Google Chrome

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

问题描述

我在Google Chrome中的固定元素遇到了一些问题。该元素的行为与其他主流浏览器应该一样。



这是css:

  #element {position:fixed; bottom:0px;宽度:100%; height:50px; z-index:10;} 

问题是,当页面加载时,元素被固定为它应该是视口的底部。滚动时,它保持与加载页面时的相同位置 - 它不会固定在屏幕的底部。



任何帮助都非常感谢。

谢谢 解决方案



  -webkit-transform:translateZ(0); 


I am having some trouble with a 'fixed' element in Google Chrome. The element behaves as it should in other major browsers.

Here is the css:

#element { position: fixed; bottom: 0px; width: 100%; height: 50px; z-index: 10;}

The issue is, when the page loads, the element is fixed at the bottom of the viewport, as it should be. Upon scrolling, it remains at the same spot where it was when the page loaded - it doesn't stay fixed to the bottom of the screen.

Any help is much appreciated.

Thanks

解决方案

try adding the following code to your element:

-webkit-transform: translateZ(0);

这篇关于位置:修正了在Google Chrome中无法使用的情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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