I'm trying to write CSS for iPhone 5 or similar devices with small screen height. Things are getting worse when mobile keyboard is opened and there are very few space on a screen. I want to remove few elements when page gets very short due to keyboard.
So I've tried this
@media all and (max-height: 400px) {
display: none;
}
But element is still present on the page when keyboard pops up. And page height definitely less than 400px.
UPDATE
I'm asking because I saw few question on SO (for example here) or articles outside of SO which saying that virtual keyboard affect height or even orientation (because orientation considered portrait if height is more that width, but on smaller devices when keyboard pops up width becomes more than height and device switches to landscape mode).
Is it still actual or outdated behavior?
I've tried also
@media all and (orientation: landscape) {
...
}
Yes, it works when device in landscape mode. No, it does not work when keyboard pops up and height of webpage is less than its width.