CSS transform: translate moves postion:fixed inner Div

风格不统一 提交于 2019-11-30 14:50:09

问题


The following example shows a div inside a div. The inner div is

position: fixed;

When I add

transform: translate(0px, 0px);

to the outer div, the inner div will no longer behave as fixed

Link to the example: http://dabblet.com/gist/1723937

So, does translate actually change the viewport? Can anyone help me to keep the inner div fixed using css, when the outer div has a translate style?

Thank you, Felix


回答1:


Here is an article on it:

http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/

Hope you find it helps.



来源:https://stackoverflow.com/questions/9115880/css-transform-translate-moves-postionfixed-inner-div

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