position:fixed not working in chrome 22

夙愿已清 提交于 2020-01-02 05:42:07

问题


i'm new with html5 and css3. I released my first website last month and now i found out that it's not working well in the new chrome version (22): All the fixed elements are no longer fixed... The navigation bar on the top of the screen for example. it was fine only a week ago and i have no idea why now it's not. This is the website: www.biofilter.co.il

As far as i can tell, it's still working fine in Firefox and IE.

Does anyone has an idea what's going on and what could be the reason?


回答1:


Your problem is likely caused by Chrome reworking how position:fixed elements handle stacking of z-index. The change was made for Chrome v22 so if you built on v21 and use position:fixed, you might have a problem.

They suggested testing by hitting the Chrome special URL about:flags in the browser, and setting Fixed position elements create stacking contexts. to true (for v22+) or false (for v21).

It is possible to rework your CSS by ensuring position:fixed elements are stacking correctly. Unfortunately, it is a little complicated so recommend you read these for better explanation:

  • Stacking changes coming to position:fixed elements
  • Elaborate description of Stacking Contexts


来源:https://stackoverflow.com/questions/12781115/positionfixed-not-working-in-chrome-22

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!