Since we can’t detect if a website is standalone or not in php, I did it in javascript. I wanted to hide all the website with a white div and write a little sentence in it to say to add the app to home screen. (I maked it red while testing).
I tried <div style="width:100%;height:100%;" ></div> of course with the body and the html at 100% too; but there was a white space at the right and the bottom of the page. (I think it was for the scroll bar).
Then I set the width and the height to 110% and the overflow of the body and the html to hidden; but it didn’t work. (A problem with overflow:hidden in iPhones).
Then I wanted to set the size of my div to the size of the device (with media queries), but when I switch from portrait to landscape, the size keeps the same and the div doesn’t expand.
Can someone tell me a way to do this? (Maybe using javascript to change the class)
Just put a the div just beneath the body:
CSS:
This will make the div as large as the screen.