how How to make a fixed div in IE10 Mobile?

 

Questions


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?

 

 

————————————————-

Answer

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;

css,html,internet-explorer-10,windows-phone,windows-phone-8

Facebook Comments

Post a comment