How to make a fixed div in IE10 Mobile?

非 Y 不嫁゛ 提交于 2019-12-24 02:07:09

问题


How do you make a fixed div that works with IE10 Mobile on Windows Phone 8? The code I am currently using is:

<div style="position:fixed;width:100%;background-color:blue;">
    test
</div>

This only partially works. When the user scrolls, the div slides back into its original position. It also does not work at all in landscape orientation. Are there any alternative ways to make a fixed div that does not move that are supported on Internet Explorer 10 mobile?


回答1:


div 
{
    position:fixed;
    width:100%;
    background:blue;
    top:0; /* bottom:0 */
    left:0; /* right:0 */
    height:200px; /* You can specify here as you want */
}

When Using position:fixed, you have to give atleast one side declaration. That where it should be remain fixed e.g. top:0;



来源:https://stackoverflow.com/questions/14185811/how-to-make-a-fixed-div-in-ie10-mobile

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